0.0.2 • Published 1 year ago

postcss-grayscale v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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']
	})
])