-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[IconButton] Add a size prop #14649
[IconButton] Add a size prop #14649
Conversation
26753b0
to
fa110f9
Compare
Details of bundle changes.Comparing: c0287df...75b08eb
|
09248b0
to
af5b132
Compare
@leMaik I gave this pull request a go. I'm proposing the following changes:
|
@oliviertassinari Awesome! 🎉 Anything left to be done?
The specs say 18px. I don't think we should use 20px then. The intent of this PR was to match the specs in the first place. Also, 20px + 6px total padding = 26px, which is not a very Material-Design-y number. At the moment, I only have time for Material-UI during the weekend but I try to keep the PRs coming.
That sounds like a good weekend-thing 😄 |
@leMaik As long as you can have fun during your weekends on Material-UI, it's 👌. We already have new conflicts 😆. My original motivation for the font size change was to reduce the font size cardinality. The less different values we have, the most consistent the UI should be. In this case, maybe the right move is to do the opposite, change the icon font size small value? |
af5b132
to
77a0255
Compare
@oliviertassinari Rebase ✔️ I changed the font size back to 18px, let's stick to the specs then. Some icons, e.g. the arrow, look good at 18px. 18px is also the size of the table sorting label (according to the specs and my previous PR). |
@oliviertassinari The specs pretty clearly say padding=3, size=18. It looks fine to me. |
@leMaik I'm comparing the visual output, the specification values assume a lot about how the icons are positioned within the available space. The material svg icons are wasting a lot of space:
|
@oliviertassinari In the table specs, the wasted space of the icon is included in the 18px (18px including the wasted space). I'd assume that it's the same here. That said, I don't see a point in a long debate about two pixels of size 😅 |
@leMaik Ok cool, what do you think of making the svg icon and font icon small font size be 18px? |
@oliviertassinari Changing the small size would break people's UIs. 😱 |
It's a major, wouldn't it be better to have only 3 icon font size values than 4? |
@oliviertassinari An icon is more like a building block. I didn't ever use it as a standalone component and never needed a |
This PR adds a
size
property to theIconButton
component. Setting it tosmall
applies density as described in the Material Design Guidelines:Regarding the demo: The delete icon looked ugly in the small size, but the arrow looks fine.