4.0.5 • Published 7 months ago
@csstools/postcss-hwb-function v4.0.5
PostCSS HWB Function
npm install @csstools/postcss-hwb-function --save-dev
PostCSS HWB Function lets you use the hwb()
color function in CSS, following CSS Color Module 4.
a {
color: hwb(194 0% 0%);
}
b {
color: hwb(194 0% 0% / .5);
}
/* becomes */
a {
color: rgb(0, 196, 255);
}
b {
color: rgba(0, 196, 255, 0.5);
}
Usage
Add PostCSS HWB Function to your project:
npm install postcss @csstools/postcss-hwb-function --save-dev
Use it as a PostCSS plugin:
const postcss = require('postcss');
const postcssHWBFunction = require('@csstools/postcss-hwb-function');
postcss([
postcssHWBFunction(/* pluginOptions */)
]).process(YOUR_CSS /*, processOptions */);
Options
preserve
The preserve
option determines whether the original notation
is preserved. By default, it is not preserved.
postcssHWBFunction({ preserve: true })
a {
color: hwb(194 0% 0%);
}
b {
color: hwb(194 0% 0% / .5);
}
/* becomes */
a {
color: rgb(0, 196, 255);
color: hwb(194 0% 0%);
}
b {
color: rgba(0, 196, 255, 0.5);
color: hwb(194 0% 0% / .5);
}
4.0.5
7 months ago
4.0.4
8 months ago
4.0.3
8 months ago
3.0.18
11 months ago
3.0.16
12 months ago
3.0.17
11 months ago
4.0.1
10 months ago
4.0.0
10 months ago
4.0.2
10 months ago
3.0.15
1 year ago
3.0.14
1 year ago
3.0.13
1 year ago
3.0.12
1 year ago
3.0.11
1 year ago
3.0.10
1 year ago
3.0.9
1 year ago
3.0.8
1 year ago
3.0.7
1 year ago
3.0.4
2 years ago
3.0.3
2 years ago
3.0.2
2 years ago
3.0.1
2 years ago
3.0.6
2 years ago
3.0.5
2 years ago
3.0.0
2 years ago
2.2.2
2 years ago
2.2.1
2 years ago
2.2.0
2 years ago
2.1.1
2 years ago
2.1.0
2 years ago
2.0.1
2 years ago
2.0.0
2 years ago
1.0.2
3 years ago
1.0.1
3 years ago
1.0.0
3 years ago