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

Since it's a mega-thread, re-added to the agenda, I will repost a few things. The primary use-cases are:

- Being able to override third party styles when we have no way to put them in a layer. This might include internal app styles being overridden by a user.
- Overriding legacy unlayered code, with newer layered styles. This can be used as part of a site refactor.
- The progressive enhancement use-case is interesting… But the longer this takes, the less compelling it becomes. 😅

The three general approaches that have been [proposed](https://github.com/w3c/csswg-drafts/issues/6323#issuecomment-2207341923) – each one with various naming options:

1. `!unlayered` 😕 - (or `initial` or `*` or…) - Provide name the 'un-layered layer' so that it can be placed in the layer order like any other layer. While this sounds the simplest in some ways, it leads to issues with coordination across style sheets, and provides no way for later-introduced layers to demote themselves below unlayered styles.
2. `!<layer-name>` 🎉 - (or `up`/`down` or `/` or `@layer!` or…) - Provide a way of specifying for each layer if it belongs above or below unlayered styles. This is very flexible, but complicated to reason about - tracking two distinct layer orders.
3. `!overrides` 🚀 - (or `!important` or `!top` or…) – Provide a single pre-defined and permanently positioned layer _above_ unlayered styles. In some ways this is a variation on option 2, but maybe simpler to reason about, since it relies on existing concepts.

I don't think option 1 is really viable here, so we're likely discussing variations on option 2 or 3. 

If people have additional use-cases, or new syntax ideas, feel free to note them here. But try not to rehash all the earlier debates on existing proposals. I don't know that we'll make a decision from straw-poll here, but it might be interesting to know if people have favorites. Feel free to react with one of the emoji above (yes I chose the frown for option 1 🤷🏻‍♀️).

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


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

Received on Thursday, 10 October 2024 19:34:56 UTC