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

So, maybe I'm just missing something, but can't `!overrides` be used to simulate `!my-layer-name` anyway by simply nesting custom layers inside `!overrides`?

It does feel a little weird that no such extra nesting has to be done with layers below unlayered styles, but from a practical view, I don't see how these two proposals differ much if at all.

The only thing is, I don't remember if `@layer !overrides.my-layer { /* styles */ }` would currently be correct syntax (I know it's a thing for ordering layers at least)

Just one extra thought: I feel like `!overrides` and `important!` are close enough as keywords that it might be worth considering naming this magic layer `important!` as well, to make it more obvious what it does for people reading CSS that don't keep up with every latest addition.

That would get us to something like:

```css
@layer important!.code-font {
   code { font-family: monospace }
}
```

which to me both looks nice enough and should cover most use-cases I can think of.

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


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

Received on Monday, 8 July 2024 08:10:27 UTC