-
-
Notifications
You must be signed in to change notification settings - Fork 78.5k
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
Some widgets use hardcoded breakpoint names for their media queries #20833
Comments
But we can't rely on that in the general case. CC: @mdo |
Yeah I've struggled to think of a way to do this right... I don't know that there is one that scales well without adding too many complications to the source code. I'm open to more suggestions on how to make it work, but otherwise I think it might be outside our scope unfortunately. |
Could it work by passing an index instead of the hardcoded name like |
@mdo @cvrebert I think I have a decent solution. The $grid-breakpoint-xs: xs !default;
$grid-breakpoint-sm: sm !default;
$grid-breakpoint-md: md !default;
$grid-breakpoint-lg: lg !default;
$grid-breakpoint-xl: xl !default; Then you can use the variable instead of the hard-coded name: $grid-breakpoint-xs: xxs;
$grid-breakpoint-sm: xs;
$grid-breakpoint-md: sm;
$grid-breakpoint-lg: md;
$grid-breakpoint-xl: lg; |
@mdo @cvrebert could you take a look at my proposed solution? It scales well and doesn't add any complications. |
@mdo @judowalker I found the source of the problem. The fact is that in the file I hope it will help to improve it |
This issue is similar to #20548, however in my case I want to change the breakpoint names as follows:
This seems to work as far as generating the columns. However, some of the Bootstrap scss files call the
media-breakpoint-*
mixin with a breakpoint name that no longer matches my breakpoint names. For example,_carousel.scss
calls@include media-breakpoint-up(sm)
which results in 768px in my case instead of 544px. I would have to manually change it to@include media-breakpoint-up(xs)
for it to be correct with my breakpoint names.Since the number of breakpoints are the same, perhaps some type of mapping can be used to map the mixin argument to the grid-breakpoint (e.g.
@include media-breakpoint-up(sm)
maps to xs: 544px in$grid-breakpoints
).The text was updated successfully, but these errors were encountered: