Re: [csswg-drafts] [css-fonts] [palettes] font-palette cannot be expanded in the future (#6633)

Yeah, there's several possible methods to address this, and we've used all of them, as I outlined last month in [a similar @scroll-timeline issue](https://github.com/w3c/csswg-drafts/pull/6472#issuecomment-902831765):

1. Use dashed-ident for author-defined names, so they're guaranteed safe and separated from CSS-defined ones. (Example: `color()` keywords.)
2. Let the namespaces mingle, but author-defined wins over CSS-defined. (Example: `@counter-style` names)
3. Let the namespaces mingle, but CSS-defined wins over author-defined. (Example: `@font-face` names)

(3) is fine if we expect to expand the set rarely or never, and/or expect that the names we'd add are unlikely to be used by authors. It's better than 2 if there are security or perf reasons to want the predefined names to be well-known and immediately resolveable.
(2) is fine if we don't have the above expectation, but are okay with the possibility that an author naively uses a predefined name but accidentally gets something custom (not realizing that the name has been overridden somewhere else in the page's styles). In the case of @counter-style, we also didn't want to make a big deal of which languages we happened to predefine vs ones we forced authors to implement, for sensitivity reasons.
(1) is always safe and easy, it just clearly separates out author-defined from CSS-defined.

For this, I don't see a particular reason not to go with (1); it seems like the easiest route.

> Making the @font-palette-values rule win actually might be a feature in its own right - it lets an author intentionally redefine what the "light" palette is for a particular font, rather than just using the first palette with the USABLE_WITH_LIGHT_BACKGROUND bit set.

This is legitimate, tho we can mix it up with dashed-ident if we'd like, defining light/dark to be specifically overrideable while the other keywords aren't.  Or we could make them all overrideable; I don't have a strong opinion. CSS doesn't have a precedent.

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


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

Received on Friday, 17 September 2021 16:16:24 UTC