Re: [csswg-drafts] [css-easings-2] Accept `<number> | <percentage>` in `linear()` (#9287)

In theory this could be done. Two meaningful downsides, tho:

1. We'd have to fix the argument order - output, then input. Gradients already fix their grammar in that order (tho for no particularly good reason), so it would match, but we try to avoid fixing grammar order if we can avoid it.
2. (probably more important) It becomes genuinely harder to distinguish the values if they can both be the same type, or either type. If you read `linear(0 10%, 20% 1)`, it would be *very reasonable* to presume that the %s match up and the numbers match up, equivalent to `linear(0 10%, 1 20%)`, but under your proposal they'd actually match up purely positionally, so it's equivalent to `linear(0 10%, .2 100%)` instead. Forcing the two values to use different types aids readability here, and the particular usage of numbers vs percentages draws useful parallels with other syntaxes like gradients.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9287#issuecomment-2347171174 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 20:23:35 UTC