source: frontend/node_modules/@csstools/postcss-ic-unit/README.md

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 13 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 2.7 KB
Line 
1# PostCSS IC Unit [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS Logo" width="90" height="90" align="right">][postcss]
2
3
4[<img alt="npm version" src="https://img.shields.io/npm/v/@csstools/postcss-ic-unit.svg" height="20">][npm-url]
5[<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/ic-unit.svg" height="20">][css-url]
6[<img alt="Build Status" src="https://github.com/csstools/postcss-plugins/workflows/test/badge.svg" height="20">][cli-url]
7[<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord]
8
9[PostCSS IC Unit] lets you use the ic length unit, following the [CSS Values and Units Module] specification.
10
11```pcss
12p {
13 text-indent: 2ic;
14}
15
16.bubble {
17 width: calc(8ic + 20px);
18}
19
20/* becomes */
21p {
22 text-indent: 2em;
23}
24
25.bubble {
26 width: calc(8em + 20px);
27}
28```
29
30_See prior work by [JLHwung](https://github.com/JLHwung) here [postcss-ic-unit](https://github.com/JLHwung/postcss-ic-unit)
31To ensure long term maintenance and to provide the needed features this plugin was recreated based on JLHwung's work._
32
33## Usage
34
35Add [PostCSS IC Unit] to your project:
36
37```bash
38npm install postcss @csstools/postcss-ic-unit --save-dev
39```
40
41Use it as a [PostCSS] plugin:
42
43```js
44const postcss = require('postcss');
45const postcssIcUnit = require('@csstools/postcss-ic-unit');
46
47postcss([
48 postcssIcUnit(/* pluginOptions */)
49]).process(YOUR_CSS /*, processOptions */);
50```
51
52[PostCSS IC Unit] runs in all Node environments, with special
53instructions for:
54
55| [Node](INSTALL.md#node) | [PostCSS CLI](INSTALL.md#postcss-cli) | [Webpack](INSTALL.md#webpack) | [Create React App](INSTALL.md#create-react-app) | [Gulp](INSTALL.md#gulp) | [Grunt](INSTALL.md#grunt) |
56| --- | --- | --- | --- | --- | --- |
57
58## Options
59
60### preserve
61
62The `preserve` option determines whether the original source
63is preserved. By default, it is not preserved.
64
65```js
66postcssIcUnit({ preserve: true })
67```
68
69```pcss
70p {
71 text-indent: 2ic;
72}
73
74/* becomes */
75
76p {
77 text-indent: 2em;
78 text-indent: 2ic;
79}
80```
81
82[postcss]: https://github.com/postcss/postcss
83
84[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test
85[css-url]: https://cssdb.org/#ic-unit
86[discord]: https://discord.gg/bUadyRwkJS
87[npm-url]: https://www.npmjs.com/package/@csstools/postcss-ic-unit
88
89[Gulp PostCSS]: https://github.com/postcss/gulp-postcss
90[Grunt PostCSS]: https://github.com/nDmitry/grunt-postcss
91[PostCSS]: https://github.com/postcss/postcss
92[PostCSS Loader]: https://github.com/postcss/postcss-loader
93[CSS Values and Units Module]: https://www.w3.org/TR/css-values-4/#ic
94[PostCSS IC Unit]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-ic-unit
Note: See TracBrowser for help on using the repository browser.