As far as I know Sass lighten function works like this:
lighten($myColour, 20%);
But if you look at this online tool for creating colours:
enter link description here
It creates them as follow without the %:
lighten($myColour, 20);
Is this OK? Does it make any difference using 20 or 20% ?
Thanks
As mentioned in the Sass documentation, the function lighten is said:
lighten($color, $amount)
where
$amount (Sass::Script::Value::Number) — The amount to increase the lightness by, between 0% and 100%
So it can be both. I tested it in this CodePen example and it gave both the same hex value of color.
.lighten-number {
color: lighten(red, 20);
}
.lighten-percentage {
color: lighten(red, 20%);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With