1.0.0 • Published 7 years ago

postcss-hex-format v1.0.0

Weekly downloads
1,004
License
MIT
Repository
github
Last release
7 years ago

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