Package Exports
- css-color-grab-cli
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (css-color-grab-cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
CSS Color Grab CLI
Small command line tool that extracts all uses of a single color from a CSS file.
Installation
npm install css-color-grab-cli
Examples
Consider this simple CSS file called style.css:
body {
margin: 0;
color: #585858;
background-color: #ffffff;
line-height: 1.5;
}
h1 {
color: #585858;
font-size: 3em;
margin-bottom: 1.5em;
}
p {
color: #585858;
}
.entry-meta {
background-color: #ffffff;
}
Run a command from the same directory
css-color-grab 585858 style.css
And you'll get this in your terminal:
body,
h1,
p
{
color: #585858;
}
Grabbing white color
css-color-grab ffffff style.css
Will give you this:
body,
.entry-meta
{
background-color: #fff;
}
To save the output to a file:
css-color-grab 585858 style.css dark.css