This plugin will format hexadecimal colors.
npm install postcss-hex-format --save
const config = {
length: "long",
case: "upper"
};
postcss([ require('postcss-hex-format')(config) ])
// do your processing here 🎉
Or use it in some other PostCSS way.
Possible values: short
or long
.
Default: long
Use this option to define whether hex colors should be lengthened or shortened if possible.
Possible values: upper
or lower
.
Default: upper
Use this option to define whether hex colors should be uppercase or lowercase.
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;
}