SCSS lighten function
- 06 Apr 2017: Post was created (diff)
SASS has a lighten function along with other color manipulation utilities (e.g. darken) which are really easy to use.
pink-website.scss
$primary: #ff0000;
body {
background-color: lighten($primary, 30%);
color: darken($primary, 20%);
}
Which compiles into the following
body {
background-color: #ff9999;
color: #990000;
}
It takes two arguments; color
and amount
.
If you have any comments or feedback, please send me an e-mail. (stig at stigok dotcom).
Did you find any typos, incorrect information, or have something to add? Then please propose a change to this post.