1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-21 04:41:36 +02:00

Drop color(), theme-color() & gray() functions (#29083)

Drop `color()`, `theme-color()` & `gray()` functions  in favor of variables. The functions just called a `map-get()` of a map where just the variables were defined. 

Also the `theme-color-level()` now accepts any color you want instead of only `$theme-colors` colors. The first value now is a variable instead of the `$theme-colors` key.
This commit is contained in:
Martijn Cuppens
2019-07-25 09:41:13 +02:00
committed by XhmikosR
parent 172d580db3
commit 1c05c1dbf1
7 changed files with 30 additions and 58 deletions

View File

@@ -93,22 +93,8 @@
@return if($yiq >= $yiq-contrasted-threshold, $dark, $light);
}
// Retrieve color Sass maps
@function color($key: "blue") {
@return map-get($colors, $key);
}
@function theme-color($key: "primary") {
@return map-get($theme-colors, $key);
}
@function gray($key: "100") {
@return map-get($grays, $key);
}
// Request a theme color level
@function theme-color-level($color-name: "primary", $level: 0) {
$color: theme-color($color-name);
// Request a color level
@function color-level($color: $primary, $level: 0) {
$color-base: if($level > 0, $black, $white);
$level: abs($level);