interop icon indicating copy to clipboard operation
interop copied to clipboard

SVG stroke-alignment

Open shalanah opened this issue 1 year ago • 1 comments
trafficstars

Being able to specify stroke on outside or inside a closed path could open up a lot of great designs and less hacks like avoiding paint-order or clipping/masking svg elements. If the path isn't closed it could fallback to default behavior (middle alignment) as it does in Illustrator.

Would love some discussion around this spec + alignment.

Spec

https://svgwg.org/specs/strokes/#SpecifyingStrokeAlignment

Stack Overflow discussion (opened in 2011)

https://stackoverflow.com/questions/7241393/can-you-control-how-an-svgs-stroke-width-is-drawn

shalanah avatar Sep 23 '24 18:09 shalanah

Folks have been asking about this for what feels like forever. But oddly enough no browser bugs have ever been filed so let's fix that:

Chromium: https://issues.chromium.org/issues/369111074 Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=1920592

Can someone with a webkit account open one for Safari?

jsnkuhn avatar Sep 24 '24 10:09 jsnkuhn

Worth noting that the stackoverflow article posted in the OP has been viewed 192,000 times over the last 13 years.

image

jsnkuhn avatar Sep 30 '24 20:09 jsnkuhn

Hi @shalanah, similar to https://github.com/web-platform-tests/interop/issues/719 this issue wasn't considered for Interop 2025 because it didn't have the right labels and the Interop team didn't notice it at the time. Sorry about that.

I see that there aren't any tests for stroke-alignment in web-platform-tests, so that would be important to address if you want to propose this again for Interop 2026. But I think drumming up support for the feature on the browser bugs might be more productive, we've rarely accepted a proposal that isn't implemented in any browser yet. In Chromium, +1 on bugs is a good way to signal that you want something.

I'll go ahead and close this now.

foolip avatar Feb 21 '25 16:02 foolip

Just went back to double check and there is an open Webkit bug for this: https://bugs.webkit.org/show_bug.cgi?id=180968

jsnkuhn avatar Feb 21 '25 17:02 jsnkuhn