Complete the code to lighten the color by 20%.
$light-color: lighten(#336699, [1]);
The lighten function takes a color and a percentage to make the color lighter. Here, 20% lightens the color noticeably.
Complete the code to darken the color by 15%.
$dark-color: darken(#cc3333, [1]);
The darken function makes the color darker by the given percentage. 15% is a moderate darkening.
Fix the error in the code to correctly lighten the color by 30%.
$new-color: lighten(#00ff00, [1]);
The lighten function requires a percentage with the % sign. Using just 30 (without %) causes an error.
Fill both blanks to darken the background by 10% and lighten the text by 25%.
background-color: darken([1], [2]); color: lighten(#ffffff, 25%);
The background color is darkened by 10% using darken(#123456, 10%). The text color is lightened by 25% from white.
Fill all three blanks to create a button with a base color, a lighter hover color, and a darker active color.
.button {
background-color: [1];
&:hover {
background-color: lighten([2], [3]);
}
&:active {
background-color: darken(#0077cc, 15%);
}
}The base button color is #0055aa. On hover, it lightens by 20%. On active, it darkens by 15%.