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

Move stroke-width from path to svg at build time #631

Merged
merged 1 commit into from
Mar 1, 2022

Conversation

bradlc
Copy link
Contributor

@bradlc bradlc commented Mar 1, 2022

Closes #241

This PR automates adding the stroke-width attribute to the root svg element and removing it from any path elements, for the outline icons.

@bradlc bradlc merged commit 05d5a67 into master Mar 1, 2022
@bradlc bradlc deleted the move-stroke-width-to-svg branch March 1, 2022 18:03
@ctsstc
Copy link

ctsstc commented Mar 3, 2022

Awesome, thanks!

Sounds like I should be able to remove my global style fix:

svg.stroke-1 > path {
  stroke-width: 1px;
}

From a refactoring perspective, I'm just wondering if you used a grep/find/replace, or an AST/codemod to change all of these, or if you did it all by hand 😲

@adamwathan
Copy link
Member

@ctsstc This was the only actual change, the rest of the files are generated by running our build script 👍🏻 We commit the compiled icons for legacy reasons, but will probably remove them if we ever do a 2.0.

image

@ctsstc
Copy link

ctsstc commented Mar 16, 2022

Thanks for the response @adamwathan

That makes things easy! It's definitely hard to find the difference in the PR due to the bloat from the build artifacts. (Even if it was hiding at the end there.)

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

Successfully merging this pull request may close these issues.

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