Skip to content

[css-values-5] Require two or more random-item()s #8386

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cdoublev opened this issue Feb 1, 2023 · 3 comments
Closed

[css-values-5] Require two or more random-item()s #8386

cdoublev opened this issue Feb 1, 2023 · 3 comments

Comments

@cdoublev
Copy link
Collaborator

cdoublev commented Feb 1, 2023

I am not sure whether the current requirement of one or more random items in random-item() is intentional or if it should be two or more:

- <random-item()> = random-item( <random-caching-options> ';' <declaration-value> [ ';' <declaration-value> ]* )
+ <random-item()> = random-item( <random-caching-options> ';' <declaration-value> [ ';' <declaration-value> ]+ )

Alternatively:

<random-item()> = random-item( <random-caching-options> [ ';' <declaration-value> ]{2,} )

@brandonmcconnell
Copy link

@cdoublev I think one or more would be better, so when we spread() values arbitrarily (re #8391), they can contain any non-zero number of values.

@tabatkins
Copy link
Member

The current restriction is intentional. It's perfectly well-defined to select from a list of length 1, and consistent with the behavior of lengths >1. (As opposed to an empty list, which would have to have some novel behavior.)

@cdoublev cdoublev closed this as completed Apr 1, 2023
@cdoublev
Copy link
Collaborator Author

cdoublev commented Apr 1, 2023

Thank you both for your clarification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants