-
Notifications
You must be signed in to change notification settings - Fork 465
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
[Media queries] Negation is ignored when nested media queries exist #2425
Comments
It works well if .block {
@media (min-width: 600px) {
@media not print {
color: green;
}
}
} |
Media queries are not very flexible with the "not" operation, see https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries. Sass should probably error in this situation, although we may be able to convert the logic in certain cases (e.g. inverting the min-width to a max-width statement, to invert the intention, albeit I did not really think hard if that makes sense). |
@nex3 I've noticed the output between Ruby and Dart Sass is different in this case. Can you please confirm the correct output. Input .block {
@media not print {
@media (min-width: 600px) {
color: green;
}
}
} Ruby Sass Dart Sass @media not print and (min-width: 600px) {
.block {
color: green;
}
} |
This is complicated. I can say for sure that Dart Sass is wrong: However, the most recent media query spec is more flexible in the syntax it supports for queries. It allows |
I talked to @tabatkins, who says
I think we should follow Ruby Sass's behavior here and just emit nothing until some browser actually supports more advanced queries. |
👍 |
Looking closer at the spec, it looks like it's irrelevant for this specific case anyway— |
...although I suppose |
There was a typo when this logic was ported over from Ruby Sass. Fixes sass#2425 Spec sass/sass-spec#1243
There was a typo when this logic was ported over from Ruby Sass. Fixes #2425 Spec sass/sass-spec#1243
There was a typo when this logic was ported over from Ruby Sass. Fixes #2425 Spec sass/sass-spec#1243
libsass 3.5.0.beta.3-54-gdebb1e32
http://libsass.ocbnet.ch/srcmap/#LmJsb2NrIHsKICBAbWVkaWEgbm90IHByaW50IHsKICAgIEBtZWRpYSAobWluLXdpZHRoOiA2MDBweCkgewogICAgICBjb2xvcjogZ3JlZW47CiAgICB9CiAgfQp9
input.scss
Actual results
Expected result
The text was updated successfully, but these errors were encountered: