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

I also like option 3 because it creates a symmetry between this and #10094. And it can be made even more intuitive with symmetric names like `@layer !first` vs `@layer !last`.

To refer to this whole feature without using any syntax from any of the options, I will use the term "**post-unlayered** styles", since the goal is to allow layered styles after unlayered styles. (Hopefully this helps instead of adding even more confusion).

Putting aside bikeshed concerns, I would like to get clarity on two points:
1. **Should we allow placing post-unlayered styles inside a layer?**
   - Assuming option 3, this question can be rephrased as "Is `foo.!overrides` possible?"
   - I can see it being useful, but at the same time it feels like you should just be able to use regular sub-layers if you're already using layers.
   - I think it would be simpler if this `!overrides` (or `<insert-name-here>`) syntax was only allowed at the top-level _outside_ any other layers.
2. **How does `revert-layer` work with unlayered and post-unlayered styles?** My understanding is listed below (assuming there is no `!important` or active animations anywhere):
   - `revert-layer` used in an inline `style` attribute will revert to the post-unlayered styles.
   - `revert-layer` used in post-unlayered styles will revert to unlayered styles. (The assumption here is that unlayered styles are effectively treated like an implicit layer).
   - `revert-layer` used in unlayered styles will revert to layered styles, and then to shadow context, and then to presentational hints (same as today).

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


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

Received on Friday, 5 July 2024 18:13:58 UTC