aboutsummaryrefslogtreecommitdiff
path: root/scss
diff options
context:
space:
mode:
authorShohei Yoshida <[email protected]>2020-08-05 03:51:19 +0900
committerGitHub <[email protected]>2020-08-04 21:51:19 +0300
commite8566e10c74e05c232a0d6da801198bd9cd55b09 (patch)
tree96056f587bea988b8838440efdfe44cb5926e350 /scss
parent9181c84f0f4536aaeea3ec3157271dcc5d7d6e39 (diff)
downloadbootstrap-e8566e10c74e05c232a0d6da801198bd9cd55b09.tar.xz
bootstrap-e8566e10c74e05c232a0d6da801198bd9cd55b09.zip
box-shadow() mixin allow 'null' and drop support 'none' with multiple args (#30394)
* Support 'null' and drop `none` with multiple args * Output a warning when use 'none' with multiple arguments * Add migration note * Update migration.md Co-authored-by: Mark Otto <[email protected]> Co-authored-by: XhmikosR <[email protected]>
Diffstat (limited to 'scss')
-rw-r--r--scss/mixins/_box-shadow.scss16
1 files changed, 7 insertions, 9 deletions
diff --git a/scss/mixins/_box-shadow.scss b/scss/mixins/_box-shadow.scss
index 0726d4359..4172541f3 100644
--- a/scss/mixins/_box-shadow.scss
+++ b/scss/mixins/_box-shadow.scss
@@ -2,17 +2,15 @@
@if $enable-shadows {
$result: ();
- @if (length($shadow) == 1) {
- // We can pass `@include box-shadow(none);`
- $result: $shadow;
- } @else {
- // Filter to avoid invalid properties for example `box-shadow: none, 1px 1px black;`
- @for $i from 1 through length($shadow) {
- @if nth($shadow, $i) != "none" {
- $result: append($result, nth($shadow, $i), "comma");
- }
+ @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 (length($result) > 0) {
box-shadow: $result;
}