No media query for xs
See original GitHub issueHi
There are a great mixins for media query media-breakpoint-*, but it’s not possible to build media query for xs.
I tried to use media-breakpoint-between(xs, xs). In my opinion it should return:
@media (min-width: 0) and (max-width: 576px) {
but it returns:
@media (min-width: null) and (max-width: 576px) {
The problem is in breakpoint-min function:
@function breakpoint-min($name, $breakpoints: $grid-breakpoints) {
$min: map-get($breakpoints, $name);
@return if($min != 0, $min, null);
}
This small fix with return solves the problem:
@function breakpoint-min($name, $breakpoints: $grid-breakpoints) {
$min: map-get($breakpoints, $name);
@return $min;
}
So null will be returned only when breakpoint does not exists.
Issue Analytics
- State:
- Created 6 years ago
- Comments:12 (5 by maintainers)
Top Results From Across the Web
Overview - Bootstrap
Bootstrap primarily uses the following media query ranges—or ... No media query necessary for xs breakpoint as it's effectively `@media (min-width: 0) {...
Read more >Twitter Bootstrap 3: how to use media queries? - Stack Overflow
I.e. you would first code the XS size and then have these media overrides ... less than 576px) // No media query for...
Read more >What are media queries in Bootstrap 4? - Educative.io
Media queries are a CSS feature that enables the content of a website to adapt to different screen sizes and resolutions, thus customizing...
Read more >Flexible layouts without media queries - LogRocket Blog
The problem with media queries is that they don't play well with design systems, as components within said systems usually are defined with ......
Read more >Approaches to Media Queries in Sass - CSS-Tricks
Using media queries in CSS as part of responsive websites is bread and ... Not the logic we're looking for */ @media (min-width:...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Yes, I did, but how about larger condition? Ex.
media-breakpoint-between(xs, sm). The problem is that the function breakpoint-min never returns 0, but it shoud. Secondly something like:Could return:
instead of:
or instead like now:
nullshould be never returned becouse it’s not correct css value in this case.#23997 merged, so closing.