2d3ca553 |
1 | @charset "UTF-8"; |
2 | |
3 | /// Mixes a color with white. |
4 | /// |
5 | /// @argument {color} $color |
6 | /// |
7 | /// @argument {number (percentage)} $percent |
8 | /// The amount of white to be mixed in. |
9 | /// |
10 | /// @return {color} |
11 | /// |
12 | /// @example scss |
13 | /// .element { |
14 | /// background-color: tint(#6ecaa6, 40%); |
15 | /// } |
16 | /// |
17 | /// // CSS Output |
18 | /// .element { |
19 | /// background-color: #a8dfc9; |
20 | /// } |
21 | |
22 | @function tint( |
23 | $color, |
24 | $percent |
25 | ) { |
26 | @if not _is-color($color) { |
27 | @error "`#{$color}` is not a valid color for the `$color` argument in " + |
28 | "the `tint` mixin."; |
29 | } @else { |
30 | @return mix(#fff, $color, $percent); |
31 | } |
32 | } |