开发者社区> 镜像站> NPM> postcss-ic-unit
postcss-ic-unit
Use the ic length unit in CSS
Last updated 2 months ago by jlhwung .
CC0-1.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install postcss-ic-unit 
SYNC missed versions from official npm registry.

PostCSS IC Unit PostCSS Logo

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:

Node Webpack Create React App Gulp Grunt

Options

preserve

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

Current Tags

  • 2.0.0                                ...           latest (2 months ago)

3 Versions

  • 2.0.0                                ...           2 months ago
  • 1.0.1                                ...           4 months ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 1
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (0)
None