postcss-grayscale
v0.0.2
Published
PostCSS plugin to transform color to grayscale
Downloads
2
Maintainers
Readme
PostCSS Grayscale
PostCSS PostCSS plugin to transform color to grayscale.
Example
const postcssGrayscale = require('postcss-grayscale');
postcss([
postcssGrayscale()
])
/* Input example */
.red {
color: #ff0000;
}
.green {
color: #00ff00;
}
.blue {
color: #0000ff;
}
/* Output example */
.red {
color: #363636;
}
.green {
color: #B6B6B6;
}
.blue {
color: #121212;
}
options
type
const postcssGrayscale = require('postcss-grayscale');
postcss([
postcssGrayscale({
type: 'Lab'// HSL/HSI/YUV
})
])
properties
const postcssGrayscale = require('postcss-grayscale');
postcss([
postcssGrayscale({
properties: ['color', 'background', 'background-color']
})
])