Skip to content

[css-images-4] Restriction on <percentage> values in stripes() #9551

Open
@cdoublev

Description

@cdoublev

<percentage> is currently restricted to [0,100] in stripes() otherwise the function is invalid:

<color-stripe> = <color> && [ <length-percentage> | <flex> ]?

  • <percentage [0,100]>: [...] Only values between 0% and 100% (inclusive) are valid.
  • <length [0,∞]> : [...] Negative length values are invalid.

I agree with #9516 (comment) that values outside this range are meaningless.

But then I am not sure why they make sense in <alpha-value> or <brightness()> (for example), which produce different animating behaviors (because <alpha-value> is clamped at parse time).

However my main concern is <length-percentage> expanding to <length [0,∞]> | <percentage [0,100]>, which is not great for grammar driven parser, therefore I suggest this change:

- <color-stripe> = <color> && [ <length-percentage> | <flex> ]?
+ <color-stripe> = <color> && [ <length [0,∞]> | <percentage [0,100]> | <flex> ]?

Note that <length-percentage [0,]> is not problematic because [0,] can be "inherited" during expansion.

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