1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-30 08:39:56 +02:00

Colors rewrite (#30622)

This commit is contained in:
Martijn Cuppens
2020-10-13 09:58:06 +02:00
committed by GitHub
parent 5c6925385e
commit cdc12165a9
15 changed files with 150 additions and 139 deletions

View File

@@ -150,24 +150,24 @@ $_luminance-list: .0008 .001 .0011 .0013 .0015 .0017 .002 .0022 .0025 .0027 .003
@return mix(rgba($foreground, 1), $background, opacity($foreground) * 100);
}
// Request a color level
// scss-docs-start color-level
@function color-level($color: $primary, $level: 0) {
$color-base: if($level > 0, $black, $white);
$level: abs($level);
@return mix($color-base, $color, $level * $theme-color-interval);
}
// scss-docs-end color-level
@function tint-color($color, $level) {
@return mix(white, $color, $level * $theme-color-interval);
// scss-docs-start color-functions
// Tint a color: mix a color with white
@function tint-color($color, $weight) {
@return mix(white, $color, $weight);
}
@function shade-color($color, $level) {
@return mix(black, $color, $level * $theme-color-interval);
// Shade a color: mix a color with black
@function shade-color($color, $weight) {
@return mix(black, $color, $weight);
}
// Scale a color:
// Shade the color if the weight is positive, else tint it
@function scale-color($color, $weight) {
@return if($weight > 0, shade-color($color, $weight), tint-color($color, -$weight));
}
// scss-docs-end color-functions
// Return valid calc
@function add($value1, $value2, $return-calc: true) {
@if $value1 == null {