[Button] Vertical text alignement issue on Firefox
See original GitHub issue- The issue is present in the latest release.
- I have searched the issues of this repository and believe that this is not a duplicate.
Current Behavior 😯
Buttons do not render properly with correct padding. As you can see, the text looks raised and is higher than it should be. While this seems like a small issue, it is noticeable when using rounded buttons and is an issue in production.
No amount of `button::-moz-focus-inner` or any other found solution does the trick.Expected Behavior 🤔
Button should render with text centered.
Steps to Reproduce 🕹
Steps:
- Import and create button
- Open button on Chrome and Firefox
- See that padding is different
Context 🔦
This is an issue, mostly, for buttons that have rounded edges. It’s fairly noticeable and frustrating, especially since we can’t get it to stop doing this. Can you possibly add Firefox support for this so it stops happening automatically?
Your Environment 🌎
Tech | Version |
---|---|
Material-UI | v4.9.9 |
React | v16.13.1 |
Browser | Firefox |
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
[Button] Vertical text alignement issue on Firefox #23637
This is an issue, mostly, for buttons that have rounded edges. It's fairly noticeable and frustrating, especially since we can't get it to...
Read more >HTML button text alignment in Firefox - css - Stack Overflow
The horizontal alignment of the [+] button is off in Firefox, but not in Chrome? What's going on and how can I fix...
Read more >Browser differences for vertical alignment of text -- who is right?
Firefox seems to offset text downwards by one pixel by default. Except for Arial? Expected results: Vertical positioning of text should be the...
Read more >Problem with Mozilla for button's text alignment..... - MSDN
My problem is that, "Button text aligns at bottom for mozilla firefox." and it works fine with other browsers.
Read more >CSS Fix for Firefox Button text vertical alignment
CSS Fix for Firefox Button text vertical alignment ... input::-moz-focus-inner /*Remove button padding in FF*/ { border: 0; padding: 0; }.
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
This only happens on Firefox (as far as I have tested) and I’m not using a custom font. Problably this is related to #19584.
https://github.com/mui-org/material-ui/issues/19584#issuecomment-582852051
This is definitely an inconsistency with some fonts @jasminnancy , especially prevalent when icons are in there as well
Firefox on Linux
Chromium on Linux
This is actually a pretty old “issue” which has to do with the fact that FF is implementing font metrics accorrding to spec, while the Chromium browsers are not.
See
Could this be fixed on the font level @oliviertassinari ? There are some fonts that work the same on both browsers, but Roboto ain’t one of them.Turns out I had not actually loaded the Roboto font 😅 The Ubuntu font for example looks the same on both browsersChromium on Linux
Firefox on Linux