Skip to content
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

[css-media-queries] Nesting Media Queries #1191

Closed
andresgalante opened this issue Apr 9, 2017 · 3 comments
Closed

[css-media-queries] Nesting Media Queries #1191

andresgalante opened this issue Apr 9, 2017 · 3 comments

Comments

@andresgalante
Copy link

andresgalante commented Apr 9, 2017

Hi,
This is related to: https://www.w3.org/TR/mediaqueries-4/

I just found myself in a situation where I wanted to nest media queries. For example:

@media (min-width: 50em) {
  ...
  and @media (orientation: landscape) { ... }
}

I know I can use and on a new declaration, but nesting them makes it so much nicer IMO.

Is this something that others think it's useful or I am just pushing it?

@Loirooriol
Copy link
Contributor

I don't know media queries, but doesn't the following already work?

@media (min-width: 50em) {
  /* ... */
  @media (orientation: landscape) { /* ... */ }
}

Example: https://jsfiddle.net/9kt1gozg/

@frivoal
Copy link
Collaborator

frivoal commented Apr 10, 2017

As @Loirooriol pointed out, it is already allowed:
https://drafts.csswg.org/css-conditional/#contents-of

Closing, since there's nothing to fix.

@andresgalante
Copy link
Author

@Loirooriol it does work!

thanks 👍

@frivoal frivoal added the Testing Unnecessary Memory aid - issue doesn't require tests label Jul 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants