Closed wh1100717 closed 9 years ago
In Stylus:
hsl(0deg, 0%, 17%) // #2b2b2b lighten(#2b2b2b, 10) // #454545 hsl(0deg, 0%, 27%) // #454545 lighten(#2b2b2b, 10%) // #404040 hsl(0deg, 0%, 25%) // #404040
In Stylus, if the input type is numeric, lighten/darken use lightness += amount to get the new lightness(HSL color model), else if the input type is percent, lighten/darken use lightness += (1 - lightness) * percent to get the new lightness.
lightness += amount
lightness += (1 - lightness) * percent
In Less:
hsl(0deg, 0%, 17%) // #2b2b2b lighten(#2b2b2b, 10%) // #454545 hsl(0deg, 0%, 27%) // $454545
It is just simply using lightness += amount to get the new lightness.
The color function is so weird in Less/SASS... So CSS needs a hero <_<
However~~ We could use lighten(#2b2b2b, 10) in Stylus to get the same color calculation result in LESS.
This is great. Thanks!
In Stylus:
In Stylus, if the input type is numeric, lighten/darken use
lightness += amount
to get the new lightness(HSL color model), else if the input type is percent, lighten/darken uselightness += (1 - lightness) * percent
to get the new lightness.In Less:
It is just simply using
lightness += amount
to get the new lightness.The color function is so weird in Less/SASS... So CSS needs a hero <_<
However~~ We could use lighten(#2b2b2b, 10) in Stylus to get the same color calculation result in LESS.