Skip to content

[css-fonts-4] font-palette:light and font-palette:dark are a bit disingenuous #7048

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
litherum opened this issue Feb 14, 2022 · 6 comments
Closed
Labels
Closed as Retracted When the person who raised the issue thinks that there's no issue after all. css-fonts-4 Current Work

Comments

@litherum
Copy link
Contributor

litherum commented Feb 14, 2022

The font can indicate certain palettes as USABLE_WITH_LIGHT_BACKGROUND or USABLE_WITH_DARK_BACKGROUND.

CSS says:

light: Some color font formats include metadata marking certain palettes as applicable on a light (close to white) background. This keyword causes the user-agent to use the first available palette in the font file marked this way.

However, a palette that is usable on a light background will probably involve dark colors. Therefore, when you say font-palette: light you are usually actually specifying a color palette whose colors are dark.

Switching the meaning of light and dark is probably not the right solution, though - the opentype flags say nothing about the foreground colors of the palettes. Maybe we should just copy the names from OpenType and rename light to usable-with-light-background? Or usable-with-background(light)?

@litherum litherum added the css-fonts-4 Current Work label Feb 14, 2022
@litherum litherum changed the title font-palette:light and font-palette:dark are a bit disingenuous [css-fonts-4] font-palette:light and font-palette:dark are a bit disingenuous Feb 14, 2022
@tabatkins
Copy link
Member

Hmmmmmm, but light matches with the (prefers-color-scheme: light) value.

Your suggested names are a mouthful, but considering shorter ones, I don't think mentioning "scheme" would help - calling a palette "light color scheme" would probably also imply (perhaps even more strongly!) that it involves light colors.

Maybe just rewording the description to more directly reference the concept of light color schemes and referencing the MQ would help, and let us keep the short names? With an example showing off setting the palette to light or dark based on the MQ being light or dark?

@litherum
Copy link
Contributor Author

Hmmmmmm, but light matches with the (prefers-color-scheme: light) value.

That's a good point! When authors say (prefers-color-scheme: light) they mean the background is light but the foreground is (probably) dark.

I guess the difference is that, at least in my mind, "color scheme" implicitly includes both the foreground and background colors together as a package, but font color palettes only include the foreground.

Your suggested names are a mouthful

Maybe just font-palette: light-background ??? 🤔

@drott
Copy link
Collaborator

drott commented Feb 15, 2022

I have no strong opinion on this, but I tend to agree with Tab that short names can reasonably clearly be associated with the color schemes by the same name. Indeed, light means likely dark colors in the font, but if it's explained to be "goes with light scheme / light background", I think it's reasonably clear and not too verbose. +1 from my side to extending the explanation with an example and making reference to the prefers-color-scheme media query.

@svgeesus
Copy link
Contributor

I agree that similar names to the existing (light mode, dark mode) naming is clear and not likely to cause confusion.

@litherum
Copy link
Contributor Author

Okay let's close this then.

@svgeesus svgeesus added the Closed as Retracted When the person who raised the issue thinks that there's no issue after all. label Feb 15, 2022
@litherum
Copy link
Contributor Author

76b751b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closed as Retracted When the person who raised the issue thinks that there's no issue after all. css-fonts-4 Current Work
Projects
None yet
Development

No branches or pull requests

4 participants