- Notifications
You must be signed in to change notification settings - Fork7
Use the gray() color function in CSS
License
postcss/postcss-color-gray
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
PostCSS Gray lets you use thegray() color function in CSS, following the outdated version ofCSS Color Module Level 4 specification (05 November 2019).
gray() has been removed fromColor Module Level 4 specification.
body {background-color:gray(100);color:gray(0/90%);}/* becomes */body {background-color:rgb(255,255,255);color:rgba(0,0,0,.9);}
AddPostCSS Gray to your project:
npm install postcss postcss-color-gray --save-dev
UsePostCSS Gray to process your CSS:
importpostcssGrayfrom'postcss-color-gray';postcssGray.process(YOUR_CSS/*, processOptions, pluginOptions */);
Or use it as aPostCSS plugin:
importpostcssfrom'postcss';importpostcssGrayfrom'postcss-color-gray';postcss([postcssGray(/* pluginOptions */)]).process(YOUR_CSS/*, processOptions */);
PostCSS Gray runs in all Node environments, with special instructions for:
| Node | Webpack | Create React App | Gulp | Grunt |
|---|
Thepreserve option determines whether the originalgray() function shouldbe preserved or replaced. By default, thegray() function is replaced.
By settingpreserve totrue, the originalgray() function is preserved.
postcssGray({preserve:true});
body {background-color:gray(100);color:gray(0/90%);}/* becomes */body {background-color:gray(100);background-color:rgb(255,255,255);color:gray(0/90%);color:rgba(0,0,0,.9);}
About
Use the gray() color function in CSS
Topics
Resources
License
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Contributors6
Uh oh!
There was an error while loading.Please reload this page.