comparison default/assets/scss/vendors/bourbon/library/_shade.scss @ 0:1d038bc9b3d2 default tip

Up:default
author Liny <dev@neowd.com>
date Sat, 31 May 2025 09:21:51 +0800
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:1d038bc9b3d2
1 @charset "UTF-8";
2
3 /// Mixes a color with black.
4 ///
5 /// @argument {color} $color
6 ///
7 /// @argument {number (percentage)} $percent
8 /// The amount of black to be mixed in.
9 ///
10 /// @return {color}
11 ///
12 /// @example scss
13 /// .element {
14 /// background-color: shade(#ffbb52, 60%);
15 /// }
16 ///
17 /// // CSS Output
18 /// .element {
19 /// background-color: #664a20;
20 /// }
21
22 @function shade(
23 $color,
24 $percent
25 ) {
26
27 @if not _is-color($color) {
28 @error "`#{$color}` is not a valid color for the `$color` argument in " +
29 "the `shade` mixin.";
30 } @else {
31 @return mix(#000, $color, $percent);
32 }
33 }