postcss-hex-format

PostCSS plugin to format hexadecimal colors

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
postcss-hex-format
1.0.05 years ago5 years agoMinified + gzip package size for postcss-hex-format in KB

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;
}

Related