question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tailwind stroke-width classes are ignored due to the hardcoded path attribute

See original GitHub issue

I’ve started using the outline icons in a new project, with Tailwind CSS. I’ve run into a problem since Tailwind’s stroke-width stroke-1 etc. classes don’t work, because each <path> has a hard-coded stroke-width="2" attribute that overrides the inherited class style.

Could stroke-width="2" be placed on the <svg> element instead? According to the spec this is still inherited (so defaults work), but a class style takes precedence because of specificity. My own quick tests on latest Chrome, Safari, and Firefox confirm this.

I’m using the SVG code directly (inlining in HTML), though it seems like this would be an issue for all the methods. I can fix this manually on each icon, but it’s a pain…

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:24
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

7reactions
andronoceancommented, May 21, 2021

Heads up to anyone watching this, my PR resolving this is now available at #281. Tests and (if necessary) corrections are welcome!

2reactions
andronoceancommented, May 17, 2021

What’s the status on this issue ?

@Kerosz I haven’t had time to do this yet, and I still haven’t seen anything from the actual heroicons maintainers about it… Nonetheless, I now need this urgently myself at work, so you can expect a fork & PR in the next few days.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Content Configuration - Tailwind CSS
Configuring source paths. Tailwind CSS works by scanning all of your HTML, JavaScript components, and any other template files for class names, ...
Read more >
Tailwind CSS classes is not working in my project?
This error is due to tailwind not finding any classes to scan in what it 'thinks' is your HTML code directories.
Read more >
tailwindcss | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
‍♀️ ‍♂️ Tailwind CSS with Heroicons: The SVG path stoke ...
Yes, Tailwind CSS has a class stroke-{number} that allows you to customize this attribute only for the element that has it. But in...
Read more >
Why I Don't Like Tailwind CSS | Aleksandr Hovhannisyan
With that out of the way, let's look at some of the reasons why I don't ... Because Tailwind classes are atomic building...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Hashnode Post

No results found