postcss-hex-format
v1.0.0
Published
PostCSS plugin to format hexadecimal colors
Downloads
5,531
Maintainers
Readme
postcss-hex-format
This plugin will format hexadecimal colors.
Installation
npm install postcss-hex-format--save
Usage
const config = {
length: "long",
case: "upper"
};
postcss([ require('postcss-hex-format')(config) ])
// do your processing here 🎉
Or use it in some other PostCSS way.
Options
length
Possible values: short
or long
.
Default: long
Use this option to define weither hex colors should be lengthened or shortened if possible.
case
Possible values: upper
or lower
.
Default: upper
Use this option to define wheither hex colors should be uppercase or lowercase.
Example
If you configure it to use the long form and uppercase as shown in the usage and process the following:
a {
color: #abc;
}
You will get this result:
a {
color: #AABBCC;
}