1.0.0 • Published 6 years ago

postcss-brightness v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

PostCSS Brightness

NPM Version Build Status BGitter Chat

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.