Skip to content

Where in csswg-drafts does it mention and no longer joins nested media queries? #1605

Answered by romainmenke
bschlenk asked this question in Q&A
Discussion options

You must be logged in to vote

But the postcss-nesting docs say that in the latest version at rules are not combined with the and keyword.

That only refers to an implementation detail.
Instead of naively doing a string concat with and and thereby breaking some cases, we leave nested at rules as they appear in your source code.

This is done because browsers have long supported nested at rules.

For example:

@media (width) or (color) {
  @media (min-width: 400) {}
}

Concatting with and is obviously wrong here: (width) or (color) and (min-width: 400)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@bschlenk
Comment options

Answer selected by bschlenk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants