Re: [csswg-drafts] [css-syntax][css-nesting] Design of `@nest` rule (#10234)

>  It's necessary to write manually if you're using .insertRule() though, isn't it?

As I keep arguing, that's a very advanced usage. You don't teach people how to use .insertRule() (or really any of the OM except `.style`, probably) in a beginner CSS course. It's something needed *extremely* rarely, for advanced CSS tooling use-cases only.

And, as I've argued, the cost of "when I, a CSS tooling author, use `.insertRule()`, I have to *use a rule* of some sort (and `@nest`, or whatever we call it, is the easiest) to insert a block of declarations between two other rules" is more than outweighed by the benefit of "when I, a CSS tooling author, do arbitrary manipulations to the OM, everything works in a simple and expected way, and the structures appear in close correspondence with the method calls I make". 

> Could someone who believes @nest is a good solution, please answer this question… pretend a community college professor is emailing you, and asks: "I want to teach my students to use CSS Nesting. Could you explain when / how / where they should use the new https://github.com/nest rule? What does that nested CSS look like?"

I wrote something to this effect in [my previous comment](https://github.com/w3c/csswg-drafts/issues/10234#issuecomment-2130412422).

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


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

Received on Tuesday, 28 May 2024 22:32:40 UTC