close
The Wayback Machine - https://web.archive.org/web/20250306212510/https://github.com/tailwindlabs/tailwindcss/discussions/3286
Skip to content

Stroke Width not working on SVG with React #3286

Answered by simonswiss
josegomes123 asked this question in Help
Discussion options

You must be logged in to vote

Hey!

Chances are that you are applying stroke-1 to the svg element, but the strokeWidth attribute is overriding this because it's declared on the path element itself.

If you add className="stroke-1" to the path which has the strokeWidth attribute, it should works (I just tried on a NextJS project with the academic-cap heroicon, and it worked 👍

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
3 replies
@josegomes123
Comment options

@simonswiss
Comment options

@Ankushch27
Comment options

Answer selected by simonswiss
Comment options

You must be logged in to vote
1 reply
@kwadoskii
Comment options

Comment options

You must be logged in to vote
1 reply
@dpkshrma
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
6 participants