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

Icon sizing has padding? #664

Closed
ctsstc opened this issue Apr 6, 2022 · 1 comment
Closed

Icon sizing has padding? #664

ctsstc opened this issue Apr 6, 2022 · 1 comment

Comments

@ctsstc
Copy link

ctsstc commented Apr 6, 2022

It drives me crazy that if I'm using tailwind to size the heroicon I'll end up wanting something that's 16x16 (w-4) so I have to make the outer container 20x20 (w-5) so that I end up with a 16x16 icon. This also can get weird with layouts when you don't want padding. Padding should be a choice not built-in.

It seems that if I manually set the viewBox to 2 2 16 16 on something like x-circle then it respects the sizing.

@ctsstc ctsstc changed the title Sizing is weird and padded? Icon sizing has padding? Apr 6, 2022
@adamwathan
Copy link
Member

Hey! There's no intent to really bake in "padding" per se, it's just that every icon needs to be drawn on the same canvas size for the set to work together, and for the icons to look balanced when used together, some of them need more whitespace than others.

image

You can see the lightning bolt uses all of the available vertical space (except for 1px), and the speaker uses all of the horizontal space. The vertical and horizontal menu icons of course have lots of space on horizontal axis and vertical axis respectively.

The only way to remove all whitespace for each icon would be to make the artboards different shapes and sizes for each icon, and then you couldn't size them as easily.

No plans to change this — we designed these icons for ourselves and the way they are built has worked perfectly for our own projects. We released them as a gift, which is why this is an MIT licensed open source project. If you need icons that are implemented differently, perhaps these are at least a helpful starting point, but even if they aren't of course you are free to make your own icons for yourself just we made these icons for ourselves 👍🏻

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

2 participants