githubEdit

PostCSS Color Hex Alpha

NPM Versionarrow-up-right CSS Standard Statusarrow-up-right Build Statusarrow-up-right Support Chatarrow-up-right

PostCSS Color Hex Alphaarrow-up-right lets you use 4 & 8 character hex color notation in CSS, following the CSS Color Modulearrow-up-right specification.

body {
  background: #9d9c;
}

/* becomes */

body {
  background: rgba(153, 221, 153, 0.8);
}

Usage

Add PostCSS Color Hex Alphaarrow-up-right to your project:

npm install postcss-color-hex-alpha --save-dev

Use PostCSS Color Hex Alphaarrow-up-right to process your CSS:

const postcssColorHexAlpha = require('postcss-color-hex-alpha');

postcssColorHexAlpha.process(YOUR_CSS /*, processOptions, pluginOptions */);

Or use it as a PostCSSarrow-up-right plugin:

PostCSS Color Hex Alphaarrow-up-right runs in all Node environments, with special instructions for:

Options

preserve

The preserve option determines whether 4 & 8 character hex color notation should be preserved in their original form. By default, these are not preserved.

Last updated