2.0.0 • Published 4 years ago

postcss-ic-unit v2.0.0

Weekly downloads
1
License
CC0-1.0
Repository
github
Last release
4 years ago

PostCSS IC Unit

NPM Version CSS Standard Status Build Status Support Chat

PostCSS IC Unit lets you use the ic length unit, following the CSS Values and Units Module specification.

p {
  text-indent: 2ic;
}

.bubble {
  width: calc(8ic + 20px);
}

/* becomes */

p {
  text-indent: 2em;
  text-indent: 2ic;
}

.bubble {
  width: calc(8em + 20px);
  width: calc(8ic + 20px);
}

Usage

Add PostCSS IC Unit to your project:

npm install postcss postcss-ic-unit --save-dev

Use PostCSS IC Unit to process your CSS:

import postcssICUnit from 'postcss-ic-unit';

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

Or use it as a PostCSS plugin:

import postcss from 'postcss';
import postcssICUnit from 'postcss-ic-unit';

postcss([
  postcssICUnit(/* pluginOptions */)
]).process(YOUR_CSS /*, processOptions */);

PostCSS IC Unit runs in all Node environments, with special instructions for:

NodeWebpackCreate React AppGulpGrunt

Options

preserve

The preserve option determines whether the original ic declaration should remain in the CSS. By default, the original declaration is preserved.