Re: [csswg-drafts] [css-gaps-1] Serializing `column-rule` shorthand from separate longhands (#12201)

Thanks @oSamDavis.

A couple of observations:
- In cases where there are no repeaters, it should always be possible to line the lists up via LCM
- Integer repeaters can always be expanded to equivalent non-repeater lists

Given those two observations, I think it is in fact possible to produce a shorthand for case 3, though it would require expanding the lists out to 36 values each.

So a naive algorithm for serialization might be to first expand all integer repeaters; then if there are no unaligned auto repeaters, serialize using LCM. But that might go against author expectations in simple cases. For example, if I specify:

```css
column-rule: repeat(5, thin solid black, thick solid gray);
```

That decomposes into:
```css
column-rule-width: repeat(5, thin thick);
column-rule-style: repeat(5, solid solid);
column-rule-color: repeat(5, black gray);
```

And I might expect serialization of the shorthand to recompose to what was originally specified. Or maybe that would be too magical?

I think we need to figure out the right tradeoffs between implementation complexity and preserving what was originally specified. Agenda+ to take the WG's temperature on this.

-- 
GitHub Notification of comment by kbabbitt
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12201#issuecomment-3133028372 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 29 July 2025 15:25:08 UTC