tailwindlabs / heroicons

A set of free MIT-licensed high-quality SVG icons for UI development.
https://heroicons.com
MIT License
21.45k stars 1.28k forks source link

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

Closed bradlc closed 2 years ago

bradlc commented 2 years ago

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.

ctsstc commented 2 years ago

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 commented 2 years ago

@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 commented 2 years ago

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.)