We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have something like this
@media only screen and (max-width: 940px) { .test { background-color: red; } @media (min-resolution: 144dpi) { .test { background-color: green; } } } @media (min-resolution: 144dpi) { .test { background-color: yellow; } }
but this gets converted to
@media (min-resolution: 144dpi) { .test { background-color: yellow; } } @media only screen and (max-width: 940px) { .test { background-color: red; } }
so I'll lose my nested media rules :(
The text was updated successfully, but these errors were encountered:
CSS doesn't allow to use nested media queries. You should use and operator. Also you may want to use CSS preprocessors like LESS or SASS:
and
Less will compile it to
@media only screen and (max-width: 940px) { .test { background-color: red; } } @media only screen and (max-width: 940px) and (min-resolution: 144dpi) { .test { background-color: green; } } @media (min-resolution: 144dpi) { .test { background-color: yellow; } }
Sorry, something went wrong.
No branches or pull requests
I have something like this
but this gets converted to
so I'll lose my nested media rules :(
The text was updated successfully, but these errors were encountered: