source: trip-planner-front/node_modules/postcss-color-gray/README.md@ 6c1585f

Last change on this file since 6c1585f was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 2.4 KB
Line 
1# PostCSS Gray [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS" width="90" height="90" align="right">][postcss]
2
3[![NPM Version][npm-img]][npm-url]
4[![CSS Standard Status][css-img]][css-url]
5[![Build Status][cli-img]][cli-url]
6[![Support Chat][git-img]][git-url]
7
8[PostCSS Gray] lets you use the `gray()` color function in CSS, following the
9[CSSWG Specification].
10
11```pcss
12body {
13 background-color: gray(100);
14 color: gray(0 / 90%);
15}
16
17/* becomes */
18
19body {
20 background-color: rgb(255,255,255);
21 color: rgba(0,0,0,.9);
22}
23```
24
25## Usage
26
27Add [PostCSS Gray] to your project:
28
29```bash
30npm install postcss-color-gray --save-dev
31```
32
33Use [PostCSS Gray] to process your CSS:
34
35```js
36import postcssGray from 'postcss-color-gray';
37
38postcssGray.process(YOUR_CSS /*, processOptions, pluginOptions */);
39```
40
41Or use it as a [PostCSS] plugin:
42
43```js
44import postcss from 'postcss';
45import postcssGray from 'postcss-color-gray';
46
47postcss([
48 postcssGray(/* pluginOptions */)
49]).process(YOUR_CSS /*, processOptions */);
50```
51
52[PostCSS Gray] runs in all Node environments, with special instructions for:
53
54| [Node](INSTALL.md#node) | [Webpack](INSTALL.md#webpack) | [Create React App](INSTALL.md#create-react-app) | [Gulp](INSTALL.md#gulp) | [Grunt](INSTALL.md#grunt) |
55| --- | --- | --- | --- | --- |
56
57## Options
58
59### preserve
60
61The `preserve` option determines whether the original `gray()` function should
62be preserved or replaced. By default, the `gray()` function is replaced.
63
64By setting `preserve` to `true`, the original `gray()` function is preserved.
65
66```js
67postcssGray({ preserve: true });
68```
69
70```pcss
71body {
72 background-color: gray(100);
73 color: gray(0 / 90%);
74}
75
76/* becomes */
77
78body {
79 background-color: gray(100);
80 background-color: rgb(255,255,255);
81 color: gray(0 / 90%);
82 color: rgba(0,0,0,.9);
83}
84```
85
86[cli-img]: https://img.shields.io/travis/postcss/postcss-color-gray.svg
87[cli-url]: https://travis-ci.org/postcss/postcss-color-gray
88[css-img]: https://cssdb.org/badge/gray-function.svg
89[css-url]: https://cssdb.org/#gray-function
90[git-img]: https://img.shields.io/badge/support-chat-blue.svg
91[git-url]: https://gitter.im/postcss/postcss
92[npm-img]: https://img.shields.io/npm/v/postcss-color-gray.svg
93[npm-url]: https://www.npmjs.com/package/postcss-color-gray
94
95[PostCSS]: https://github.com/postcss/postcss
96[PostCSS Gray]: https://github.com/postcss/postcss-color-gray
97[CSSWG Specification]: https://drafts.csswg.org/css-color/#grays
Note: See TracBrowser for help on using the repository browser.