Skip to content
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

[material-ui][Button] Height is at 36.5px instead of 36px #34072

Open
2 tasks done
TheWilks opened this issue Aug 25, 2022 · 2 comments
Open
2 tasks done

[material-ui][Button] Height is at 36.5px instead of 36px #34072

TheWilks opened this issue Aug 25, 2022 · 2 comments
Assignees
Labels
component: button This is the name of the generic UI component, not the React module! design: material This is about Material Design, please involve a visual or UX designer in the process discussion

Comments

@TheWilks
Copy link

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

Honestly this is such a small thing but it bugs me to no end when trying to setup things in the UI consistently. The button height measures out to 36.5px when bring inspected in Chrome/Firefox/Edge when the height should be at 36px.

There seem to be some other components that were effected as well. Subtitle2 was a 22px high I believe and now its some fraction. My assumption is this was due to a browser update.

Again this is in no way a huge issue just something I have noticed.

Expected behavior 🤔

Button height should be at 36px not 36.5px

Steps to reproduce 🕹

Steps:

1.Go to MUI in any browser
2. Inspect the button component
3. View the height result

Context 🔦

It would be nice if the output height of components were not decimals at it makes precision aligning and component altering a bit more difficult when decimals need to be used.

Your environment 🌎

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.
@TheWilks TheWilks added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Aug 25, 2022
@danilo-leal danilo-leal changed the title Buttons now at 36.5px high instead of 36px [Material UI] Buttons now at 36.5px high instead of 36px Aug 26, 2022
@danilo-leal danilo-leal added component: button This is the name of the generic UI component, not the React module! design: material This is about Material Design, please involve a visual or UX designer in the process labels Aug 26, 2022
@mnajdova
Copy link
Member

mnajdova commented Jan 6, 2023

It comes from the line height being computed to 24.5px. The reason for it being decimal comes from using a unitless value for it, which based on the font size, translates to this specific pixel value. In order to get to 24px, we would need to specify the lineHeight to be 1.714285 (24/14). This is part of the theme.typography.button typography variant. cc @danilo-leal what are your thoughts on this? Is it worth to change the implementation?

@mnajdova mnajdova added discussion and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jan 6, 2023
@danilo-leal
Copy link
Contributor

I wouldn't put this specific decimal value for the line height just for the sake of locking the Button's height to 36px. However, I'm curious why the line height ends up at 24.5px, even with the translation process. Should we do some digging there, instead?

@zanivan zanivan assigned zanivan and unassigned danilo-leal Dec 4, 2023
@zanivan zanivan changed the title [Material UI] Buttons now at 36.5px high instead of 36px [material-ui][Button] Height is at 36.5px instead of 36px Dec 4, 2023
@zanivan zanivan added this to the Material UI v6 milestone Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: button This is the name of the generic UI component, not the React module! design: material This is about Material Design, please involve a visual or UX designer in the process discussion
Projects
Status: Backlog
Development

No branches or pull requests

6 participants