Re: [csswg-drafts] [css-cascade-5] Allow authors to explicitly place unlayered styles in the cascade layer order (#6323)

One AMP developer supporting our decision _after the fact_ is not a sign that we made this choice _for AMP_ - or even for framework authors generally. That was not at all the deciding factor, or even a main consideration. I have also never heard of that lib, but I'm glad the feature works for them. We also didn't make the decision _because of_ author habits. It's very strange in a multi-mega-thread conversation to suggest that two off-hand comments were the only or main considerations. If you want me to explain why we actually chose this approach, I can (in the other thread). Either way, that ship has sailed.

Still, it would be useful for authors to have some additional controls. Over the course of this thread, we've seen a range of use-cases mentioned. But at this point we're almost completely re-treading the same ground over and over, with new people. There are three approaches that keep coming up (with minor variations of syntax). All of them have potential, and all of them have issues:

1. `!unlayered` - (or `initial` or `*` or…) some name for the 'un-layered layer' so that it can be placed in the layer order like any other layer.
2. `!<layer-name>` - (or `up/down` or the slash proposal or…) some way of specifying if a layer belongs above or below unlayered styles.
3. `!overrides` - (or `!important` or `!top` or…) a pre-defined and permanently positioned layer that can't be moved, but can be added to. 

In practice, I think @kizu's [suggestion](https://github.com/w3c/csswg-drafts/issues/6323#issuecomment-1804503198) for option 3 here supports all the `up/down` use-cases, without any major new concepts or syntax – only one new layer name. And it avoids the issues with option 1. In some ways it also mirror's @mayank99's newer proposal - in that it establishes 'meta-layers' that our current layering can live in. But rather than thinking of it as two unnamed stacks (above and below) – or two new contexts - we just name the layer above, and everything else goes below.

At this point, that would be my strong favorite.

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


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

Received on Wednesday, 3 July 2024 21:29:04 UTC