You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
625 B
31 lines
625 B
@use 'sass:color'; |
|
@use 'sass:string'; |
|
@use 'sass:meta'; |
|
|
|
$darken-multiplier: -1 !default; |
|
$lighten-multiplier: 1 !default; |
|
|
|
// Invert darkened and lightened colors |
|
@function darken($color, $amount) { |
|
@return color.adjust( |
|
$color, |
|
$lightness: $amount * $darken-multiplier, |
|
$space: hsl |
|
); |
|
} |
|
|
|
@function lighten($color, $amount) { |
|
@return color.adjust( |
|
$color, |
|
$lightness: $amount * $lighten-multiplier, |
|
$space: hsl |
|
); |
|
} |
|
|
|
@function hex-color($color) { |
|
@if meta.type-of($color) == 'color' { |
|
$color: string.slice(color.ie-hex-str($color), 4); |
|
} |
|
|
|
@return '%23' + string.unquote($color); |
|
}
|
|
|