mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-21 18:54:30 +01:00
add theme-color-level function and interval so we can generate shades of colors
This commit is contained in:
parent
9372eef9e1
commit
6c595d2cc1
@ -67,6 +67,20 @@
|
|||||||
@function color($key: "blue") {
|
@function color($key: "blue") {
|
||||||
@return map-get($colors, $key);
|
@return map-get($colors, $key);
|
||||||
}
|
}
|
||||||
|
|
||||||
@function theme-color($key: "primary") {
|
@function theme-color($key: "primary") {
|
||||||
@return map-get($theme-colors, $key);
|
@return map-get($theme-colors, $key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Request a theme color level
|
||||||
|
@function theme-color-level($color-name: "primary", $level: 0) {
|
||||||
|
$color: theme-color($color-name);
|
||||||
|
$color-base: if($level > 0, #000, #fff);
|
||||||
|
|
||||||
|
@if $level < 0 {
|
||||||
|
// Lighter values need a quick double negative for the Sass math to work
|
||||||
|
@return mix($color-base, $color, $level * -1 * $theme-color-interval);
|
||||||
|
} @else {
|
||||||
|
@return mix($color-base, $color, $level * $theme-color-interval);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -107,6 +107,8 @@ $theme-colors: (
|
|||||||
dark: $gray-800
|
dark: $gray-800
|
||||||
) !default;
|
) !default;
|
||||||
|
|
||||||
|
// Set a specific jump point for requesting color jumps
|
||||||
|
$theme-color-interval: 8% !default;
|
||||||
|
|
||||||
// Colors
|
// Colors
|
||||||
//
|
//
|
||||||
|
Loading…
x
Reference in New Issue
Block a user