-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Nested media queries using the "not" keyword should not be merged #1831
Comments
I had the thought "Since CSS allows nested media queries now, I wonder whether it's better to just remove the media merging feature from Sass." Then I discovered IE11 still doesn't support nested media queries. (IE9-11 is 8% of global users) Noting that here in case someone else thinks it. |
Wow! Didn't know that about IE11 either. |
Since browser support for nested Not nesting media queries sometimes does not seem like a good idea. At the very least it will lead to unexpected failures on IE. So the example above would be an error. This would be required: @media not all and (min-width: 500px) {
@media not all and (min-width: 800px) {
background: red;
}
} |
Note that this question came up again in sass/libsass#2425. The current cross-implementation behavior is to omit nested queries, but as more browsers natively support nested media queries this becomes a CSS compatibility question. I think going forward we should probably move to leaving nested queries as-is when they can't be successfully merged. |
This is a straightforward enough change that I don't think it needs a full proposal. @xzyfer agreed? |
Agreed
…On Fri., 13 Jul. 2018, 12:18 pm Natalie Weizenbaum, < ***@***.***> wrote:
This is a straightforward enough change that I don't think it needs a full
proposal. @xzyfer <https://github.com/xzyfer> agreed?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1831 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAjZWKPyQLAzjnDwXC8YsAF6jk0pPTdsks5uGANkgaJpZM4F6BPS>
.
|
This also adds some additional media query merging specs in places where they were lacking. See sass/sass#1831
) This also adds some additional media query merging specs in places where they were lacking. See sass/sass#1831
Closing this out since LibSass is deprecated. |
Edited by @nex3
Specs: sass/sass-spec#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:
Should compile to the same:
At 400px the background is expectedly not red.
Instead it compiles to:
At 400px the background is unexpectedly red.
The text was updated successfully, but these errors were encountered: