Sketch Now Replicates Inside & Outside Stroke Alignment

Avatar of Chris Coyier
Chris Coyier on

I was just bemoaning strokes the other week:

And that’s the trouble with text-stroke in CSS: you have no choice. It’s center-aligned stroke only. Either of the other options [outside-aligned or inside-aligned], arguably, would have been more useful.

There still is no solution for text-stroke, but SVG has the exact same problem. It’s not quite as design-ruining with SVG, since you can (and designers have been) design with center aligned strokes in mind with their vector art. Still, I’d say if we had stroke-align: [center, outside, inside]; we’d be better off.

Peter Nowell documents how Sketch now repositions the points of your shapes to replicate the different stroke alignments, if you explicitly chose those options in Sketch. Pretty useful! Since native SVG still only does center alignment, that would mean changing the stroke width after exporting would still be weird, but I suppose that’s fairly rare.

The article notes how SVG 2 accommodates for aligned strokes, but that still feels a bit up in the air.

Direct Link →