-
-
Notifications
You must be signed in to change notification settings - Fork 78.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
box-shadow()
mixin: allow 'null' and drop support 'none' with multiple args
#30394
Conversation
none
with multiple args
In cases of |
In cases of |
I agree with @MartijnCuppens. I think it should output incorrect value as it is, not implicitly fixing it. |
site/content/docs/4.3/migration.md
Outdated
@@ -42,6 +42,7 @@ Changes to our source Sass files and compiled CSS. | |||
- The `button-variant()` mixin now accepts 3 optional color parameters, for each button state, to override the color provided by `color-yiq()`. By default, these parameters will find which color provides more contrast against the button state's background color with `color-yiq()`. | |||
- The `button-outline-variant()` mixin now accepts an additional argument, `$active-color`, for setting the button's active state text color. By default, this parameter will find which color provides more contrast against the button's active background color with `color-yiq()`. | |||
- Ditch the Sass map merges, which makes it easier to remove redundant values. Keep in mind you now have to define all values in the Sass maps like `$theme-colors`. Check out how to deal with Sass maps on the [theming documentation]({{< docsref "/getting-started/theming#maps-and-loops" >}}). | |||
- The `box-shadow()` mixin now output as it is whatever when passed 'none' with multiple arguments. [See #30394](https://github.com/twbs/bootstrap/pull/30394). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might need some wording fixes. /CC @mdo
I added this Looking at code Probably with this PR checks |
I think I'm gonna change sides here, @ysds. It's actually quite easy to autofix the situations with multiple values and https://www.sassmeister.com/gist/49f9c4e91db45677f45dfd2e8d5cf397 |
@MartijnCuppens Your sassmeister doesn't work in libsass(node-sass). I think the box-shadow mixin should not do autofix.
Add or remove shadow, not 100% sure which one the user intends. It should be outputted incorrect value as it is, not implicitly fixing it. So I will change the |
And also, |
Seems to work fine with the Bootstrap setup which is node-sass based
The issue with
In our case, we probably get into this situation when people try to remove one of the shadows that would be set, so in both cases |
See the null1 and 4 cases.
Why not use $btn-active-box-shadow: null ? |
That just in our case. The mixin should expect any cases. |
I did something wrong, code doesn't work in node-sass indeed.
That doesn't work, you can't unset variables with |
I was forgetting that... I’ll reconsider this. |
dcb5d5f
to
9ad3934
Compare
box-shadow()
mixin: allow 'null' and drop support 'none' with multiple args
… args (twbs#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]>
The
box-shadow()
mixin has been changed to handlenone
with multiple arguments in #27972 and #28004, but it should benull
instead ofnone
.This PR make the
box-shadow()
mixin allownull
and drop supportnone
with multiple args. And add warning message when usednone
with multiple arguments.before: https://www.sassmeister.com/gist/bdf41c41937a614861a026169e39279e
after: https://www.sassmeister.com/gist/56fdeffc72831664e546baf22f365cdf