Skip to content
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

[css-gaps-1] Auto repeater behavior when number of gaps is less than number of values #11492

Open
kbabbitt opened this issue Jan 13, 2025 · 2 comments

Comments

@kbabbitt
Copy link
Collaborator

Gap decoration properties allow a CSS-Grid-like repeat() notation to specify patterns of repeating items. The first parameter to repeat() can be "auto" in which case we generate as many iterations as necessary to cover all the gaps.

The repeat() notation can also be combined with fixed value specifications, for example:

column-rule-color: black repeat(auto, red blue) white;

Which would produce a black decoration in the first gap, a white decoration in the last gap, and alternating red and blue decorations in the in-between column gaps.

This leaves open the question of what to do with such a combination when the number of gaps is less than the number of values provided. Currently, the spec prioritizes values before the auto repeater, then values after the auto repeater, then uses the auto repeater to fill in any missing values. Is this the best option?

@Loirooriol
Copy link
Contributor

For grid tracks, auto repeat() is ensured to expand to at least 1 repetition. https://drafts.csswg.org/css-grid/#auto-repeat

@kbabbitt
Copy link
Collaborator Author

For grid tracks, auto repeat() is ensured to expand to at least 1 repetition. https://drafts.csswg.org/css-grid/#auto-repeat

That makes sense for grid tracks. For gap decorations it would imply that, if the gap decoration properties specify more gaps than the grid properties, we'd introduce additional empty tracks just to account for the decorations. I was aiming to keep gap decorations purely a paint-time effect and not influence layout, but maybe that's not what authors would expect?

@astearns astearns moved this to FTF agenda items in CSSWG January 2025 meeting Jan 22, 2025
@astearns astearns moved this from FTF agenda items to Friday afternoon in CSSWG January 2025 meeting Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Friday afternoon
Development

No branches or pull requests

2 participants