-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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
Ignore percentage values for compare in maps #26689
Conversation
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.
Thanks a lot @romanlex, this works and it'll give the chance to author to pick %
or px
.
There has been back and forwards and discussions for a very long time about the units of the breakpoints and the fact that we don't allow them to be rem
or em
.
I'll like @patrickhlauke and @mdo to decide what are the implications of allowing %
for breakpoints.
Also if we merge this, there should be also a change in the docs here:
http://getbootstrap.com/docs/4.1/layout/grid/#grid-options
@andresgalante , @patrickhlauke @mdo : Would be really nice to see this change in one of the next minor releases... |
@@ -8,7 +8,7 @@ | |||
$prev-key: null; | |||
$prev-num: null; | |||
@each $key, $num in $map { | |||
@if $prev-num == null { | |||
@if $prev-num == null or unit($num) == "%" { |
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.
If I'm not mistaken, this only fixed % warning, if you use percentage at the biggest unit.
E.g. the bug report was: sm 500, md 700, lg 850, xl 100%.
But I have a use case, where I have only two categories: small: 80%, big: 720px. So big is never too wide for reading, but small always has a nice padding from the screen (80% width). This causes a warning still, because not the current unit is "%", but the previous unit. Can we also ignore the warning in case of unit($prev-num) == "%"
?
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.
@errge you should make a new issue
All conversation about it in #24061 (comment)
I think this is the only solution
Short:
We cant compare percantage values with absolute values in map, but many people want use
%
in$container-max-widths
Fixes #24061