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

After some thoughts, my idea: what if we'd have a _single, system layer_ which could be used to place other layers _after_ the unlayered styles?

Let's say this system layer would be named `!overrides`. Then, let's say it places nested styles after the unlayered styles _only_ within the same parent layer (if any).

What this would mean:

1. We cannot create an arms race, as we have only one entry point for every layer that can be used to put styles into an “overrides” part.
2. As we can put other layers inside this layer, we could continue to write our new styles using layers in any way.
3. We don't need to handle any specific syntax or complexity outside adding this one specific named layer.

I first wrote the comment above, then re-read the issue and found @FremyCompany proposing basically the same in a [comment above](https://github.com/w3c/csswg-drafts/issues/6323#issuecomment-939655516)

I didn't see many reservations in the discussion after that proposal, so I would say this one is probably the one I'd want to see?

It would cover most (if not all?) cases for placing styles after the unlayered styles, does not introduce a lot of complexity, and so on.

I don't think the `!important` name for it, as it brings many bad associations, as well as the whole origins thing, but would be ok with it. (But maybe we could keep the naming discussion aside until we'd understand that yes, this is the direction we'd want to go.)

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


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

Received on Thursday, 9 November 2023 19:35:08 UTC