Icon buttons have padding despite being plain
See original GitHub issueI have Buttons without labels, just icons, that I’m rendering in a Box.
I want to reduce spacing between them but the plain
prop doesn’t remove padding.
Note: could be similar to #1343
Expected Behavior
A Button
with the prop of plain
shouldn’t have padding, as per the docs:
plain Whether this is a plain button with no border or padding
Actual Behavior
The padding is still set |
---|
URL, screen shot, or Codepen exhibiting the issue
Here’s a sandbox, navigate to Button
Your Environment
- Grommet version: 2.5.5
- Browser Name and version: Firefox
- Operating System and version (desktop or mobile): Ubuntu desktop
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
How do I remove Flutter IconButton big padding?
Simply pass an empty BoxConstrains to the constraints property and a padding of zero. IconButton( padding: EdgeInsets.zero, ...
Read more >Design better buttons. Everything you need to know to have…
Inside it we create another shape to house the icon. It should have a padding inside the larger shape, that's the same size...
Read more >1160154 - [gtk3] Firefox: too much padding between icons in ...
The Gtk3 Firefox has way too much padding (space) between icons on the personal toolbar (and maybe elsewhere, in other toolbars), compared to...
Read more >How to Prevent Users from Mistapping Icons - UX Movement
To prevent users from mistapping your icons, add extra padding. Check and see if you have enough padding by placing your finger over...
Read more >Button - Graphite Design System
plain, Use for less important or less commonly used actions since they're less prominent ... As a general rule, a button should not...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fixed! thank you for filing the issue!
So the padding is applied here https://github.com/grommet/grommet/blob/master/src/js/components/Button/StyledButton.js#L121-L129
Here are some screenshots when not applying it and when we do (line height is always needed)
Don’t know if this is needed either