SVG strokeWidth is not templated to stroke-width
See original GitHub issueIn react strokeWidth
templates to valid svg prop stroke-width
, but it’s not the case for preact. Cannot find in code how to fix it.(
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:9 (3 by maintainers)
Top Results From Across the Web
svg - stroke-width doesn't scale; aspect ratio problem?
The best solution I can think of is to manually transform the coordinates of your path. vector-effect="non-scaling-vector" is not consistently ...
Read more >stroke-width - CSS-Tricks
The stroke-width property in CSS is for setting the width of a border on SVG shapes.
Read more >181122 - SVG stroke-width isn't scaled down properly when ...
When SVG is scaled down, the "stroke" (border) does not scale down with the shape. The end result is that when zoomed out,...
Read more >Stroke Width - Tailwind CSS
Utilities for styling the stroke width of SVG elements. ... to the stroke-width CSS property here so you can make your custom rows...
Read more >Imported SVG's stroke width out of proportion in QGIS
I can't see what should be wrong with it and it works fine in any vector editor, but not in QGIS. qgis ·...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I did some investigation into the spec for SVG and it looks like there isn’t any clear pattern for what formats are expected/valid. It seems like if we were to support these, we’d need to explicitly define a mapping. This would likely add more bloat to the preact source than is preferred.
Perhaps if there is interest it may be worthwhile to create a separate compat sort of addon that would support SVG?
Hiya - SVG property renaming is handled in
preact-compat
. Preact core simply uses attributes for SVG, since SVG reflected properties are read-only.That said, it might be worth exploring the idea of applying a simple transform (here) when we know we’re mutating an SVG: