[csswg-drafts] [css-shapes-2] Ambiguity when creating an arc between angle & ry (#6925)

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

== [css-shapes-2] Ambiguity when creating an arc between angle & ry ==
See https://drafts.csswg.org/css-shapes-2/#typedef-shape-arc-command:
`<arc-command> = arc <by-to> <coordinate-pair> of <length-percentage>{1,2} [ <arc-sweep> || <arc-size> || <angle> ]`

There could be arguments that are ambiguous at time of parsing between the second `length-percentage` radius and the `angle`.
For example, unclear how to parse:
`arc to 10px 10px of 5px calc(var(--some-number) * 2) cw`

Is the `calc` value the angle or the y radius?

Even if it was possible for the parser to figure this out by following the calc parameters, this is ambiguous to the reader.

Options:
- Make it mandatory to have 2 radii, maybe allowing `auto` or so for the second one to represent symmetrical radii, like:

`arc to 10px 10px of 5px auto calc(var(--some-number)*2) cw // angle`
`arc to 10px 10px of 5px calc(var(--some-number)*2) cw // radius`

- add a keyword or a function(`rotate`?) before the angle, like:
`arc to 10px 10px of 5px rotate(calc(var(--some-number)*2)) cw // angle` or `arc to 10px 10px of 5px rotate calc(var(--some-number)*2) cw // angle`
`arc to 10px 10px of 5px calc(var(--some-number)*2) cw // radius`

I think I prefer the `rotate` as keyword option. Maybe there are more options?



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


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

Received on Sunday, 2 January 2022 06:47:57 UTC