Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I want you to support stroke-width in heroicons/react #263

Closed
ru88s opened this issue Apr 24, 2021 · 4 comments
Closed

I want you to support stroke-width in heroicons/react #263

ru88s opened this issue Apr 24, 2021 · 4 comments

Comments

@ru88s
Copy link

ru88s commented Apr 24, 2021

import { BookOpenIcon } from "@heroicons/react/outline";

<BookOpenIcon className="w-10 stroke-1"/>

stroke-1 does not work.
Is there a way to adjust the stroke-width?

@ru88s ru88s changed the title I want you to support stroke-width I want you to support stroke-width in heroicons/react Apr 24, 2021
@sanderfish
Copy link

Duplicate of #241

@ukasyah99
Copy link

Is there a way to adjust the stroke-width?

Yes, it's pretty simple. You just need to write some css as follows:

/* Set heroicon's stroke width */
.heroicon-sw-2 path {
  stroke-width: 2 !important;
}
.heroicon-sw-1\.75 path {
  stroke-width: 1.75 !important;
}
.heroicon-sw-1\.5 path {
  stroke-width: 1.5 !important;
}
.heroicon-sw-1\.2 path {
  stroke-width: 1.2 !important;
}

Finally:

<BookOpenIcon className="w-10 h-10 heroicon-sw-1.5" />

Although the above example uses the jsx version, it can also be applied to the svg version #241 .

@bradlc
Copy link
Contributor

bradlc commented Feb 22, 2022

Duplicate of #241

@bradlc bradlc marked this as a duplicate of #241 Feb 22, 2022
@bradlc bradlc closed this as completed Feb 22, 2022
@Fabian-Andres
Copy link

Fabian-Andres commented Aug 24, 2022

With Tailwind ^3.0 you could use arbitrary properties like this:

<BookOpenIcon className="w-10 h-10 [&>path]:stroke-[2]" />

you can even use stroke-[2px] px, rem, em, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants