[csswg-drafts] [css-values-5] Separate `%` from `<dimension-unit>` (#7381)

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

== [css-values-5] Separate `%` from `<dimension-unit>` ==
CSS Values 5 defines [`<dimension-unit>`](https://drafts.csswg.org/css-values-5/#typedef-dimension-unit) as *a literal "%" character (that is, a `<delim-token>` with a value of "%") or an ident whose value is any of the CSS units for `<length>`, `<angle>`, `<time>`, `<frequency>`, or `<flex>` values (such as px or ms)*.

According to Wikipedia (sorry for not providing a more "academic" reference): *A percentage is a dimensionless number (pure number); it has no unit of measurement.*

According to Syntax, [`<percentage-token>`](https://drafts.csswg.org/css-syntax-3/#typedef-percentage-token) has no `unit`.

I would like to suggest separating `%` from `<dimension-unit>` and define `<attr-type>` as `string | url | ident | color | number | percentage | length | angle | time | frequency | flex | '%' | <dimension-unit>`.

The same confusion also exists in step 8.2 of [*simplify a calculation tree*](https://drafts.csswg.org/css-values-4/#simplify-a-calculation-tree):

> 2. For each set of root’s children that are numeric values with identical units, remove those children and replace them with a single numeric value containing the sum of the removed nodes, and with the same unit.
> (E.g. combine numbers, combine percentages, combine px values, etc.)

Imho, this can be reworded to *For each set of root’s children that are `<number>`, `<percentage>`, `<dimension>` with an identical `unit`, [...]*.

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


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

Received on Friday, 17 June 2022 08:59:07 UTC