Preserve dashed strokes as stroke-dasharray when exporting SVG
Issue
When I export a native dashed line from Figma as SVG, the dash pattern is converted into many disconnected subpaths within a single <path> element.
The result looks correct, but the SVG no longer describes one continuous line with a dashed stroke. Instead, it explicitly defines the start and end of every visible dash.
For example, my Figma line is 461 px long, with a 1 px stroke and a dash pattern of 6 px dash / 4 px gap. Its exported SVG contains 47 separate move commands rather than a stroke-dasharray attribute.
Current output
Here is a simplified, shorter example of the structure Figma exports. Each M…L… pair draws an individual dash:
svg code
<svg xmlns="http://www.w3.org/2000/svg"
width="1" height="30" viewBox="0 0 1 30">
<path
d="M0.5 0L0.5 3
M0.5 7L0.5 13
M0.5 17L0.5 23
M0.5 27L0.5 30"
fill="none"
stroke="#75758A"
stroke-width="1"
This is one path element, but it contains multiple disconnected subpaths. The dash pattern has effectively been baked into the geometry.
Desired output
I would like the same line exported as a continuous path using standard SVG stroke attributes:
svg code
<svg xmlns="http://www.w3.org/2000/svg"
width="1" height="30" viewBox="0 0 1 30">
<path
d="M0.5 0V30"
fill="none"
stroke="#75758A"
stroke-width="1"
stroke-dasharray="6 4"
stroke-dashoffset="3"
/>
The offset in this example preserves the partial dashes at the endpoints. If Figma adjusts dash spacing to fit a line, the exported dash-array values and offset could reflect those adjustments.
Why this matters
Preserving the dash pattern as stroke attributes would:
Produce smaller, more readable SVGs.
Make dash lengths and gaps easy to change through SVG attributes or CSS.
Allow straightforward animation using stroke-dashoffset.
Preserve the underlying continuous path for downstream editing.
Avoid needing custom export processing to reconstruct dashed strokes.
Request
Could Figma preserve native dashed strokes as stroke-dasharray and, where needed, stroke-dashoffset during SVG export?
Ideally, this would be the default for basic dashed strokes, or an export option for users who prefer semantic, editable SVG over expanded dash geometry.
Figma’s Philosophy Problem
Everything SVG export related seems to assume “only visible appearance matters.” THIS IS AN INCORRECT ASSUMPTION. Good SVG build matters for some users. “As long as the export looks exactly like the frame in the the editor UI, it doesn’t matter how the SVG is actually built in the export.” ← This is WRONG. It does not match user needs. It causes so much nightmare for my work. Please stop using that philosophy.
