Re: [csswg-drafts] [css-nesting-1] Declaration occuring after an invalid nested rule (#7501)

> From what I understand, there was some concern about how to represent interleaved declarations and selectors in CSSOM, and worry that browsers would have to store this interleaving in order to resolve [order of appearance](https://drafts.csswg.org/css-cascade-4/#cascade-order). So we have this section that requires rules to come after declarations to simplify both issues.

Yeah, basically there's no way to represent the interleaving correctly "as written", so interleaved declarations would be interpreted as if all the properties were moved to the start and rules were placed after.

That's not, like, *killer*, since the only way for it to even theoretically matter is if you interleaved a nested rule that targeted the same elements as the parent without adding any specificity, like `& {...}` or `:where(.foo) & {...}` or something. Those are likely *extremely* rare in the first place.

So, we could allow interleaving them so long as that slight wrinkle to "order of appearance" is okay. (I think it is.) We'd probably still *recommend* they be put first, tho.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7501#issuecomment-1275342990 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 11 October 2022 22:21:27 UTC