Gerillass
v2.1.0Type: Function
shade();
Mixes a colour towards black by a percentage.
Arguments
| Name | Type | Description |
|---|---|---|
$color | color | Accepts a colour. |
$percentage | number (percentage) | Accepts a percentage. |
Examples
A darker hover state derived from one brand colour.
$brand: crimson;
.button {
background-color: $brand;
}
.button:hover {
background-color: shade($brand, 20%);
}.button {
background-color: crimson;
}
.button:hover {
background-color: #b01030;
}What it refuses
Arguments are checked, so a wrong value stops the build with a message instead of quietly producing the wrong CSS.
$brand: crimson;
.button:hover {
background-color: shade(brand, 20%);
}Error: 'brand' is not a color value, please replace it with a valid one.