Skip to content

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

@noamr

Description

@noamr

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions