W3C home > Mailing lists > Public > public-css-archive@w3.org > July 2018

Re: [csswg-drafts] [css-nesting] support nesting at-rules

From: Amelia Bellamy-Royds via GitHub <sysbot+gh@w3.org>
Date: Fri, 06 Jul 2018 14:47:00 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-403055906-1530888419-sysbot+gh@w3.org>
Thanks for starting this discussion as a proper issue.

I agree that it often improves readability and reduces duplication to nest media queries inside selectors. Same, too, for `@supports` tests.

I also agree that it makes sense to move forward with this at the same time as the rest of the nesting proposal, as most of the parsing changes that will be needed could be implemented together.

The thing that is different about nested @-rules is that the _interior_ content of the rule changes. Instead of having full style rules with selectors inside the media query, we would only expect property declarations, because the selector would come from the outer context.

This therefore affects not only parsing, but also the CSSOM model for the conditional rules. Do we define new CSSOM models for the nested rules? Or do we keep them as [`CSSGroupingRule`s](https://drafts.csswg.org/css-conditional-3/#cssgroupingrule), but then make the group contents a read-only copy of the outer selector?

Of course, how this question is addressed will be tied to how the CSSOM handles the `@nest` rule and nesting in general, which is still [an open issue on the CSS Nesting proposal](https://tabatkins.github.io/specs/css-nesting/#cssom).

-- 
GitHub Notification of comment by AmeliaBR
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2891#issuecomment-403055906 using your GitHub account
Received on Friday, 6 July 2018 14:47:03 UTC

This archive was generated by hypermail 2.3.1 : Friday, 6 July 2018 14:47:04 UTC