Re: [csswg-drafts] [css-cascade] Custom Cascade Layers (formerly "custom origins") (#4470)

> Right, so at that point we're defining something that we _know_ will be obsoleted almost immediately, but will provide a footgun (in the form of a name that authors aren't allowed to use) forever. Do we believe authors are clamoring for a solution that can be well-solved by a single predefined layer _so hard_ that we think it's worthwhile to throw away effort like that?

If the second part were definitely going to ship soon after, then I would agree with you. I am suggesting we ship the first part and see if the additional complexity is warranted.

> I just reread the gist and couldn't find any gotchas listed about nested layers. Can you elaborate?

Specificity/layer depends on method of importing ([here](https://gist.github.com/mirisuzanne/4224caca74a0d4be33a2b565df34b9e7#gistcomment-3416994)). Possible confusion about how order of layer ordering works across stylesheets.
[Multiple loading](https://gist.github.com/mirisuzanne/4224caca74a0d4be33a2b565df34b9e7#gistcomment-3416989).
Need to [remember](https://gist.github.com/mirisuzanne/4224caca74a0d4be33a2b565df34b9e7#gistcomment-3416944) to put the layer on all APIs that reference a stylesheet.


> Yes, a single predefined layer is simpler than multiple layers. But we're gonna move to arbitrary named layers anyway; they can't avoid that complexity. And having both a predefined layer and arbitrary layers makes the entire feature slightly more complex than it would otherwise be, so in the end it's slightly worse, not neutral.

I don't think it's clear to me that we will need arbitrary named layers. I do think there is likely a good argument for more than one predefined layer though. I wasn't saying it's either one layer or arbitrary layers, there is a midpoint.

> I think this one's a stretch, yeah. Even with only _one_ layer, there's still at least two completely distinct and very reasonable ways to use them that would cause bad clashes between libraries: with the layer as reset/defaults and unlayered code as normal, or with the layer as "normal" and the unlayered code as spot-overrides ("better !important").

I'm not sure what the difference is between these two interpretations, can you clarify?

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


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

Received on Friday, 21 August 2020 16:27:05 UTC