-
Notifications
You must be signed in to change notification settings - Fork 189
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 problem #114
Comments
I believe we could add further checking to make sure the generated media queries actually make sense but I am not eager to do it for simplicity reasons. I strongly believe it is not the responsibility of include-media to make sure the generated media queries actually match anything. Maybe a plugin then. |
I've yet to come across a real case, where this sort of nested media queries really makes sense. |
@nirazul I can agree that this example is ambiguous, as I'm understanding it differently, as the browsers are computing it - in a way that all conditions separated by Another good example of it is this: @media (min-width: 769px) and (max-width: 1024px) and (max-width: 321px) {
width: 60%;
} That will never be applied as For the case in which it might occur is quite simple. Imagine that you got a mixin that got some I agree with @hugogiraudel as it should be a part of another plugin / post generation step thou. |
I think that instead of "rewrite" your media query if it contains some parts that exclude themselves, it should just warn you about it. Because it you end with such excluding media query, I bet it's because you made a mistake. And in this case, it must be a plugin. |
To solve the issue that was mentioned I created a separate plugin as @hugogiraudel suggested. It is in PostCSS https://github.com/panec/postcss-mq-optimize |
That's pretty cool, thanks for that. I'll close this then! 🎉 |
This is not an issue of the library, it is sass in general, but would be nice if tackling this problem would be possible. The following code:
Produces this:
When the expected outcome would be:
If that can be achieved with another library as a additional step of post processing I will be grateful for suggestions.
The text was updated successfully, but these errors were encountered: