Nested media queries using the "not" keyword should not be merged
See original GitHub issueEdited by @nex3
Specs: https://github.com/sass/sass-spec/pull/1267
Nested media queries using the not
keyword should not be merged. According to the spec, not
flips the result for the entire query and does not apply to specific chunks.
For example:
@media (min-width: 500px) {
@media not all and (min-width: 800px) {
background: red;
}
}
Should compile to the same:
@media (min-width: 500px) {
@media not all and (min-width: 800px) {
background: red;
}
}
At 400px the background is expectedly not red.
Instead it compiles to:
@media not all and (min-width: 500px) and (min-width: 800px) {
background: red;
}
At 400px the background is unexpectedly red.
Issue Analytics
- State:
- Created 8 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Using media queries - CSS: Cascading Style Sheets | MDN
The and operator can also combine multiple media features into a single media query. The not operator, meanwhile, negates a media query, ...
Read more >How to get a SASS nested nested media query to work with ...
This appears to be a case of Sass trying to write something that resembles a valid media query (since it knows that screen...
Read more >Sass Mixin and Media Merging - SitePoint
Pretty handy, isn't it? This is what is called media merging. When nested media queries are merged into a single statement. What do...
Read more >Media Queries Level 4 - W3C
1. Negating a Media Query: the not keyword. An individual media query can have its result negated by prefixing it with the keyword...
Read more >Nested Media Queries - CSS-Tricks
You can nest media queries in native CSS, as long as you're doing it from the root. It's funny to see in native...
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 FreeTop 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
Top GitHub Comments
This is a straightforward enough change that I don’t think it needs a full proposal. @xzyfer agreed?
Closing this out since LibSass is deprecated.