Skip to content

avigoldman/postcss-hex-format

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 whether hex colors should be lengthened or shortened if possible.

case

Possible values: upper or lower. Default: upper

Use this option to define whether 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

About

PostCSS plugin to format hexadecimal colors

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published