shade lighten and darken plugin for the Rework CSS preprocessing library
lighten and darken function for the Rework CSS preprocessing library.
/* using points */
The amount you put, is the percentage of white(255) that you want to decrease by. An easy way to think about it is, "I am going to lighten/darken this color by X precentage of 255(white)".
Here is the math if I wanted to decrease a color by 10%:
Mathround2.55 * -10; // yields -25
Then you take that result and subtract it from the R, G, and B colors. I have compared this to Stylus and the results are the same:
/* stylus in */
/* stylus out */
/* rework-shades in */
/* rework-shades out */
Just make sure you run/use rework-vars before shades: