Re: [csswg-drafts] [css-values-5][css-borders-4] Extending <line-width> (#13599)

The CSS Working Group just discussed `[css-values-5][css-borders-4] Extending <line-width>`, and agreed to the following:

* `RESOLVED: text-underline-width gets snapped as a border width`
* `RESOLVED: stroke-width does not snap as a border width`
* `RESOLVED: Try for gaps, if it's web-compatible.`

<details><summary>The full IRC log of that discussion</summary>
&lt;emilio> TabAtkins: couple lines ago we resolved to add hairline to line-width  (currently border- outline- column-rule widths)<br>
&lt;emilio> ... we resolved to add line-width to gap, stroke-width, and text-decoration-thickness<br>
&lt;kbabbitt> q+<br>
&lt;emilio> ... question is do we want to resolve that all those properties get pixel-snapped?<br>
&lt;emilio> q+<br>
&lt;emilio> ... are other properties we should add to this list<br>
&lt;florian> q+<br>
&lt;astearns> ack kbabbitt<br>
&lt;emilio> kbabbitt: my concern here would be webcompat with stroke-width<br>
&lt;emilio> ... because SVG does weird stuff with coordinate systems<br>
&lt;emilio> ... for existing values would like to check rendering<br>
&lt;fantasai> fantasai: We aren't snapping to 'px' though. We're snapping to device pixels.<br>
&lt;emilio> fantasai: just to clarify we won't snap to pixels, but device pixels<br>
&lt;emilio> kbabbitt: for gap it's also weird, having it a 1em default and snapping<br>
&lt;emilio> ... if it's not compatible I think it's fine<br>
&lt;emilio> florian: with the kind of snapping we'd only grow when under 1 dev pixel<br>
&lt;fantasai> emilio: For values higher than 1 pixel, the snapped value will always be less<br>
&lt;dholbert> q+<br>
&lt;astearns> ack emilio<br>
&lt;fantasai> (for values under 1 it snaps up to 1 pixel)<br>
&lt;kbabbitt> s/not compatible/web compatible/<br>
&lt;fantasai> emilio: I wouldn't do it for gap because small gaps are not that common<br>
&lt;fantasai> emilio: that seems a bit more risky becuase it does change layout<br>
&lt;fantasai> emilio: could be a bit confusing, particularly if you have some tiny gap that you've measured to fill exactly 100% and snapping makes you a little different<br>
&lt;fantasai> emilio: text-underline-thickness, uncontroversial<br>
&lt;fantasai> emilio: stroke-width I figured wouldn't affect layout so should be ok, but Kevin's right it might affect redering<br>
&lt;fantasai> TabAtkins: Fact that stroke-width is not border-snapped right now is observable<br>
&lt;fantasai> TabAtkins: that's why people shift their SVG by half a pixel, so it aligns perfectly<br>
&lt;fantasai> TabAtkins: but it would change the svgs in a noticeable way<br>
&lt;fantasai> emilio: but I think conceptually you want them snapped<br>
&lt;fantasai> kbabbitt: stroke-width anywhere other than svg?<br>
&lt;fantasai> TabAtkins: theoretically for text<br>
&lt;fantasai> emilio: but a page using a tiny scale, and then scaling the SVG<br>
&lt;fantasai> emilio: because it's pre-transform device pixels<br>
&lt;fantasai> emilio: Still might be worth trying<br>
&lt;fantasai> emilio: but I don't have high hopes there :)<br>
&lt;astearns> ack florian<br>
&lt;fantasai> florian: for gaps, I'd be inclined to try<br>
&lt;emilio> florian: when I got in the queue I wasn't aware of SVG weirdness<br>
&lt;emilio> ... for gaps I'd be inclined to try<br>
&lt;emilio> ... I think most of the time it won't matter. If you have a 1em gap it might be a bit tinier<br>
&lt;emilio> ... if you have a hairline it might be better if they're the same size<br>
&lt;astearns> ack dholbert<br>
&lt;emilio> dholbert: couple more factor, strokes there is a zero guarantee they're going to be a pixel-aligned shape<br>
&lt;emilio> ... so you're not gaining much there<br>
&lt;emilio> ... you have stroke-dasharray which you'd need to counter-snap<br>
&lt;emilio> ... for SVG strokes there's non-scaling-stroke<br>
&lt;Kurt> q+<br>
&lt;emilio> ... that is not exactly the same effect<br>
&lt;emilio> ... but is a bit similar and it might achieve some of the same results<br>
&lt;emilio> ... so in general I don't think doing this for SVG is worth it<br>
&lt;emilio> ... about gap, same concern as emilio, affects layout, and having animations that snap at different times is a bit unfortunate<br>
&lt;emilio> ... don't have a concrete testcase in mind, things that impact layout creates opportunities for that<br>
&lt;astearns> ack Kurt<br>
&lt;emilio> emilio: we do apply those to borders which do affect layout tho<br>
&lt;emilio> Kurt: more svg weirdness, what about textPath?<br>
&lt;emilio> ... do we align / snap the text?<br>
&lt;emilio> ... is the text in that path affected by that subpixel change?<br>
&lt;emilio> emilio: I _think_ it doesn't? But it might, SVG does weird stuff with strokes<br>
&lt;emilio> Kurt: would have to check<br>
&lt;Kurt> Confirmed strokeWidth does *not* impact textPath layout<br>
&lt;lea> presumably we only do so for styles != wavy or dotted, right?<br>
&lt;emilio> PROPOSED: text-underline-width gets snapped as a border width<br>
&lt;emilio> fantasai: for gap it depends on how small your gap is<br>
&lt;emilio> RESOLVED: text-underline-width gets snapped as a border width<br>
&lt;fantasai> s/it depends/benefit depends/<br>
&lt;emilio> PROPOSED: stroke-width does not snap as a border width<br>
&lt;emilio> RESOLVED: stroke-width does not snap as a border width<br>
&lt;emilio> emilio: would still be interesting to try<br>
&lt;emilio> kbabbitt: not much benefit tho<br>
&lt;emilio> dholbert: concern with gaps is why is it different from padding / margin?<br>
&lt;emilio> fantasai: gaps are more likely to be a small number<br>
&lt;emilio> ... they have the effect of looking like a line if you have a background<br>
&lt;emilio> ... a grid with gaps and a background is similar to borders<br>
&lt;emilio> florian: I'd be interested in margin / padding<br>
&lt;emilio> ... I don't think there's a rush but I think there's opportunity for that<br>
&lt;emilio> astearns: new issue for gap / margin / padding<br>
&lt;emilio> fantasai: that's more compat risky<br>
&lt;emilio> ... gaps are much more restrictive<br>
&lt;emilio> ... most of the time stuff is going to take the remaining stuff<br>
&lt;emilio> ... grid is designed around subtracting the gap<br>
&lt;emilio> ... for padding / margins etc there's more combinations that happen<br>
&lt;emilio> ... and hacks with negative margins to overlap stuff and so on<br>
&lt;emilio> ... layouts using calc() and so are more common<br>
&lt;emilio> ... for padding / margins is more risky than gaps<br>
&lt;florian> q?<br>
&lt;florian> q+<br>
&lt;emilio> ... for padding in particular you're often dealing with larger values<br>
&lt;emilio> emilio: gaps are also not always that small<br>
&lt;emilio> ... lots of "10px separation between buttons" and such things<br>
&lt;fantasai> s/remaining stuff/remaining space/<br>
&lt;emilio> fantasai: 10px and less is where I consider people noticing this<br>
&lt;emilio> ack florian<br>
&lt;astearns> ack florian<br>
&lt;emilio> florian: the case fantasai brought up where the gap makes the background show through<br>
&lt;emilio> ... so the gap in itself is a line<br>
&lt;emilio> ... so because we're doing snapping on many thing<br>
&lt;emilio> ... so I'd be inclined to try a bit more<br>
&lt;emilio> fantasai: with gap decorations you have the decoration and the gap inside the decoration<br>
&lt;emilio> ... and they can get small<br>
&lt;fantasai> emilio: Fine to try. A bit skeptical about compat<br>
&lt;fantasai> emilio: Worst case, can you remind me, did we resolve on adding a rounding function so that snapping (if you care about it) is doable?<br>
&lt;fantasai> PROPOSED: Try for gaps, if it's web-compatible.<br>
&lt;fantasai> RESOLVED: Try for gaps, if it's web-compatible.<br>
&lt;emilio> dholbert: one interesting thing is people polyfilling the gap decorations<br>
&lt;emilio> ... if we change behavior might cause cosmetic regressions<br>
&lt;emilio> ... not sure if some people actually do this tho<br>
&lt;emilio> kbabbitt: this is one where the only way to know it's to try<br>
&lt;emilio> astearns: need to add use counters where you detect a difference<br>
&lt;astearns> s/detect a difference/detect a difference in rendering both paths/<br>
&lt;fantasai> emilio: tricky to know if the dfiference is an improvement or a regression<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13599#issuecomment-4181012196 using your GitHub account


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

Received on Thursday, 2 April 2026 23:36:51 UTC