Re: [csswg-drafts] [css-values] Grammar syntax for defining excluded idents for <custom-ident> productions (#11924)

> RESOLVED: we add a new ! brackets group to the custom-ident terminal to add keywords which are excluded from production

_(I know I was on the call but I was temporarily distracted during this part of the call)_

Using the `!` for this is obvious from a programmers POV, but not in CSS since we burned the meaning of `!` with the introduction of `!important` back in the day (see [mistakes](https://wiki.csswg.org/ideas/mistakes/)). My fear here is that this will confuse authors even more when they see a `!` somewhere in their CSS.

Looking at CSS gradients we have the `to` and `at` keywords to separate _things_, so perhaps here it’s as easy as introducing a `not` here?

```
<custom-ident not none | foo | bar | <non-terminal> | something-long>
```

This is essentially the same route at the `excludes="…"`, albeit with a slightly different syntax. I read in the minutes that CSS the generally does not use keyword exclusion operators, yet I to see a lot of microsyntaxes already using something like it (gradients, shape) + we have a bunch of values that are `no-`-prefixed keywords + we have `:not()` as a selector.

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


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

Received on Thursday, 12 March 2026 09:18:43 UTC