rework-shade
Lighten and darken function for the Rework CSS preprocessing library.
This plugin is meant to share both the syntax and results of the stylus version. You can use shade({color}, +/-{amount})
or the stylus syntax of lighten|darken({color}, {amount}%)
.
Usage
Install the package via NPM.
npm install rework-shade
/* using points */
yields:
Amount explained
The amount you put, is the percentage of lightness that you want to increase or decrease the color by. We use HSL and adjust the lightness. The math used is identical to how Stylus handles it.
/* stylus in */
/* stylus out */
/* rework-shades in */
yields:
/* rework-shades out */
rework-vars support
Just make sure you run/use rework-vars before shades: