-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
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
Button text is not vertically aligned #13926
Comments
@adipascu Yes, you are right, the height of the button component is wrong 😱: It should be 36px over 37px. I propose the following fix: export const styles = theme => ({
/* Styles applied to the root element. */
root: {
...theme.typography.button,
boxSizing: 'border-box',
minWidth: 64,
minHeight: 36,
- padding: '8px 16px',
+ padding: '6px 16px', What do you think about it? Do you want to work on it? :) |
My first comment had screenshots at 200% zoom, the issue is more accentuated at normal 100% zoom, this might be also a Chrome renderer issue. @oliviertassinari woah, that fixes it for me, I posted a PR. |
* Fix text alignment by reducing button height Fix #13926 * a second try
I've got the same issue. in material UI ^4.9.12 version |
Likewise, the padding is still messed up - on chrome it is centered, on safari the padding is wrong and the button text is not centered - this issue only occurs if you specify button height in styles |
@ethoman One of the issues with vertical alignment of the text in a button is that different fonts have different centering. |
This is a weird one - I see this issue at 100% zoom in chrome, but as soon as I zoom in further, it disappears and the text is vertically centered again. I opened screenshots up in Photoshop to double check, and sure enough the 100% zoom level button has 1-2 more pixels of space below the text than it does above. |
have this problem on mui 5.6 |
Also seeing this problem on MUI 5.6.2. This issue is made especially obvious when a start or end icon is added alongside the text using the Button properties. If it helps, I was able to solve this specific outlying issue by wrapping the button text in a Box and setting the height of the Box to the height of the properly sized icon, and that allowed everything to line up, but this is far from an ideal solution. |
I'm also experiencing this issue on MUI 5.6.4. |
I feel like the buttons in material ui v3.6.2 do not have the text vertically aligned while rendering on Chrome 70.
I think that that they looked fine in material-ui v0.x but in the recent material-ui versions they are a bit taller and have a "chin" under the text.
Here are some screenshots from the docs:
The text was updated successfully, but these errors were encountered: