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

>  Given unlayered styles is a monolith, you can't have something that goes in between its parts, unless you wrap the whole preceding part with an @layer, but then it will be the backward compatibility you mention.

I was not thinking about adding parts of the same layer in-between other layers, but more thinking that the following would produce the less disruption for us.

`@layer reset, theme, blocks, !unlayered, user;`

or alternatively

`@layer reset, theme, !unlayered, blocks, user;`

The `!unlayered` is still one and only layer, it's just that at this point, I'm not 100% sure which one would be better for us between the two options above.

> But regardless of which solution will be chosen, using any layers at all will lead to the same backward compatibility issues, right?

yes, I believe so, the question I guess is which would result in the minimum breakage and to be honest only experimentation will help us figure it out. What's clear is that the unlayered layer having the smallest or the highest priority probably won't work for us.


> If you'd want to move forward, then one scenario could be: introduce a setting that will make WordPress wrap your current lower implicit layers with explicit ones.
> Let's say you'd select the Reset and Theme to go below unlayered — you could start from separating those. When !overrides or anything similar is introduced, you'll use this option to wrap the later half — the Block and User layers with it, moving those after any unstyled CSS (although, as it sounds, maybe only the User styles should be there? Alongside maybe some core utilities that need to override anything, but not all the core/block layers).
> If you can describe how a different proposal covers your use case better, please do!

If I'm not you're suggestion that theme and reset use the same layer but that's not something we want, we do want these to be separate layers, one taking precedence over the other.



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


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

Received on Thursday, 4 July 2024 07:51:32 UTC