mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-31 00:59:51 +02:00
Improve gradients
- Use a semitransparent gradient from light to dark which works on any background-color - Store the gradient as a custom property (--bs-gradient) - Remove `.bg-gradient-*` variants in favour of `.bg-gradient` which works even when `$enable-gradients` are enabled - Add gradients to navbar, active page links and badges when gradients are enabled
This commit is contained in:
committed by
XhmikosR
parent
bbeda10e37
commit
b531bda07c
@@ -1,7 +0,0 @@
|
||||
// stylelint-disable declaration-no-important
|
||||
|
||||
@mixin bg-gradient-variant($parent, $color) {
|
||||
#{$parent} {
|
||||
background-image: linear-gradient(180deg, mix($body-bg, $color, 15%), $color) !important;
|
||||
}
|
||||
}
|
@@ -97,7 +97,7 @@
|
||||
border-color: $color;
|
||||
|
||||
&:checked {
|
||||
@include gradient-bg(lighten($color, 10%), escape-svg($form-check-input-checked-bg-image));
|
||||
background-color: $color;
|
||||
}
|
||||
|
||||
&:focus {
|
||||
|
@@ -1,14 +1,10 @@
|
||||
// Gradients
|
||||
|
||||
@mixin gradient-bg($color, $foreground: null) {
|
||||
@mixin gradient-bg($color: null) {
|
||||
background-color: $color;
|
||||
|
||||
@if $enable-gradients {
|
||||
@if $foreground {
|
||||
background-image: $foreground, linear-gradient(180deg, mix($body-bg, $color, 15%), $color);
|
||||
} @else {
|
||||
background-image: linear-gradient(180deg, mix($body-bg, $color, 15%), $color);
|
||||
}
|
||||
} @else {
|
||||
background-color: $color;
|
||||
background-image: var(--bs-gradient);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user