question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[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. squareArtboard 12x-80

Screen Shot 2020-11-20 at 11 05 28 AM No amount of `button::-moz-focus-inner` or any other found solution does the trick.

Expected Behavior 🤔

Button should render with text centered. Screen Shot 2020-11-20 at 11 05 07 AM

Steps to Reproduce 🕹

Edit Material-UI issue (forked)

Steps:

  1. Import and create button
  2. Open button on Chrome and Firefox
  3. 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:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
lcdsscommented, Apr 20, 2021

@lcdss Do you have a codesandbox? Is it related to a custom font?

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

2reactions
mkarajohncommented, Jan 12, 2021

This is definitely an inconsistency with some fonts @jasminnancy , especially prevalent when icons are in there as well

Firefox on Linux image

Chromium on Linux image

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 browsers

Chromium on Linux image

Firefox on Linux image

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found