postcss-brightness
v1.0.0
Published
A PostCSS plugin to adjust or change the brightness of a color
Downloads
9
Maintainers
Readme
PostCSS Brightness
A PostCSS to adjust or change the brightness of a color
Installation
npm install postcss-brightness
Examples
Simple use, setting brightness percentage
/* input */
div { color: brightness(#34bbed, 80) }
/* output */
div { color: #a1dff7 }
Adjusting brightness
/* input */
div { color: brightness(#34bbed, +10) }
div.other { color: brightness(#34bbed, -10) }
/* output */
div { color: #63caf1 }
div.other { color: #13a4db }
Usage
Postcss JS API
postcss([require('postcss-brightness')]).process(yourCSS);
Gulp
const gulp = require('gulp');
const postcss = require('gulp-postcss');
const brightness = require('postcss-brightness');
gulp.task('css', () => {
gulp.src('path/to/dev/css')
.pipe(postcss([
brightness()
]))
.pipe(gulp.dest('path/to/build/css'));
});
Tests
npm test
License
This project is licensed under the MIT License.