[csswg-drafts] [css-fonts] How should relative-length values be interpreted when used in @font-feature-values descriptors? (#10878)

weinig has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-fonts] How should relative-length values be interpreted when used in @font-feature-values descriptors? ==
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](https://www.w3.org/TR/css-fonts-4/#font-feature-values-syntax) 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:

```css

@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](https://www.w3.org/TR/css-values-4/#math-function), such as [calc()](https://www.w3.org/TR/css-values-4/#funcdef-calc), and also [var()](https://www.w3.org/TR/css-variables-1/#funcdef-var), and [env()](https://drafts.csswg.org/css-env-1/#funcdef-env), are valid within descriptor values in a [@font-palette-values](https://www.w3.org/TR/css-fonts-4/#at-ruledef-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.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10878 using your GitHub account


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

Received on Thursday, 12 September 2024 15:51:27 UTC