mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-27 15:19:52 +02:00
Consolidate multiple 'none' values in box-shadow
Sass mixin (#41469)
This commit is contained in:
@@ -1,17 +1,23 @@
|
||||
@mixin box-shadow($shadow...) {
|
||||
@if $enable-shadows {
|
||||
$result: ();
|
||||
$has-single-value: false;
|
||||
$single-value: null;
|
||||
|
||||
@each $value in $shadow {
|
||||
@if $value != null {
|
||||
$result: append($result, $value, "comma");
|
||||
}
|
||||
@if $value == none and length($shadow) > 1 {
|
||||
@warn "The keyword 'none' must be used as a single argument.";
|
||||
@if $value == none or $value == initial or $value == inherit or $value == unset {
|
||||
$has-single-value: true;
|
||||
$single-value: $value;
|
||||
} @else {
|
||||
$result: append($result, $value, "comma");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@if (length($result) > 0) {
|
||||
@if $has-single-value {
|
||||
box-shadow: $single-value;
|
||||
} @else if (length($result) > 0) {
|
||||
box-shadow: $result;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user