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-feature-values descriptors? #10878

Open
weinig opened this issue Sep 12, 2024 · 2 comments
Labels
css-fonts-4 Current Work css-values-4 Current Work

Comments

@weinig
Copy link

weinig commented Sep 12, 2024

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

The grammars for @font-feature-values descriptors allow the use of relative-length values due to the fact that calc() allows for them.

The grammar for the declaration values is given as:

Each declaration’s value must match the grammar <integer [0,∞]>+, or else the declaration is invalid and must be ignored

For example, that would allow:

@font-feature-values foo {
    @swash { pretty: 1; cool: calc(10 - (5 * (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-feature-values.

@svgeesus svgeesus added the css-fonts-4 Current Work label Sep 16, 2024
@fantasai fantasai added the css-values-4 Current Work label Sep 16, 2024
@fantasai
Copy link
Collaborator

fantasai commented Sep 16, 2024

I can't think of a single use case for this, so if it's easier on implementations I think we can disallow it.

@tabatkins
Copy link
Member

I have the same response here as in #10877 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css-fonts-4 Current Work css-values-4 Current Work
4 participants