npm install @csstools/postcss-color-function --save-dev PostCSS Color Function lets you use the color function in CSS, following the CSS Color specification. .color { color: color(display-p3 0.64331 0.19245 0.16771); } :root { --a-color: color(srgb 0.64331 0.19245 0.16771); } /* becomes...
npm install postcss-color-function Usage // dependencies var fs = require("fs") var postcss = require("postcss") var colorFunction = require("postcss-color-function") // css to be processed var css = fs.readFileSync("input.css", "utf8") // process css // set preserveCustomProps to...
Modify colors using the color-mod() function in CSS. Latest version: 4.1.1, last published: 5 months ago. Start using postcss-color-mod-function in your project by running `npm i postcss-color-mod-function`. There are 38 other projects in the npm registr
Thepreserveoption determines whether the originalgray()function should be preserved or replaced. By default, thegray()function is replaced. By settingpreservetotrue, the originalgray()function is preserved. postcssGray({preserve:true}); body{background-color:gray(100);color:gray(0/90%); }/* ...
UsePostCSS color-mod() Functionto process your CSS: constpostcssColorMod=require('postcss-color-mod-function');postcssColorMod.process(YOUR_CSS/*, processOptions, pluginOptions */); Or use it as aPostCSSplugin: constpostcss=require('postcss');constpostcssColorMod=require('postcss-color-mod-funct...
By setting preserve to true, the original gray() 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%)...