Skip to content
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

[css-fonts] How should relative-length values be interpreted when used in @font-face descriptors? #10876

Open
weinig opened this issue Sep 12, 2024 · 1 comment

Comments

@weinig
Copy link

weinig commented Sep 12, 2024

How should relative-length values be interpreted when used in @font-face descriptors?

The grammars for @font-face descriptors, for example, 'size-adjust', allow the use of relative-length values due to the fact that calc() allows for them.

For example, using 'size-adjust' again:

@font-face {
   size-adjust: calc(50% * sign(10em - 2px));
}

So the question is, what does 10em evaluate to? @font-palette-values contains this text:

Math functions, such as calc(), and also var(), and env(), are valid within descriptor values in a @font-palette-values rule. They are evaluated within the context of the root element. Relative units are also evaluated within the context of the root element.

but I can't find any similar text for @font-face.

@svgeesus
Copy link
Contributor

I suggested that we try to solve this centrally rather than replicate the text everywhere it crops up (or should crop up). Only if a particular case needs an exception to the general rule should it be mentioned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants