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

[system] Using responsiveFontSizes results in inconsistency between <Typography> and <Box> Component #17504

Closed
2 tasks done
Skaronator opened this issue Sep 20, 2019 · 2 comments · Fixed by #23451
Closed
2 tasks done
Labels
package: system Specific to @mui/system

Comments

@Skaronator
Copy link
Contributor

  • 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 😯

A Typography component with Variant h4 doesn't match a Box component with fontSize h4

image

Expected Behavior 🤔

A Typography component with Variant h4 should match a Box component with fontSize h4
image

Steps to Reproduce 🕹

Example without Responsive Font: https://codesandbox.io/s/create-react-app-with-typescript-cujk5
Example with Responsive Font: https://codesandbox.io/s/create-react-app-with-typescript-jnw6x

Context 🔦

Not sure if this is a bug or it should work this way. Currently moving some components from Typography to the Box component and noticed this inconsistency.

Your Environment 🌎

Tech Version
Material-UI v4.4.2
React 16.9.0
Browser Chrome 75
TypeScript 3.6.3
@azz0r
Copy link

azz0r commented Oct 11, 2019

I to am having issues with this.

If I set it to "1rem" it works. If i set it to 1, "1", 12, or "12" (seen here: https://material-ui.com/customization/typography/#responsive-font-sizes) I get: Material-UI: unsupported non-unitless line height with grid alignment. Use unitless line heights instead.

@oliviertassinari oliviertassinari added the package: system Specific to @mui/system label Nov 30, 2019
@suyogn
Copy link

suyogn commented May 3, 2020

I am facing same problem,
It is an inconsistency between & font sizes in the responsive view.

I tried to use fontSize="h1.fontSize" still not working same as per the Typography.

import { ThemeProvider, responsiveFontSizes } from "@material-ui/core/styles";
typography: {
h1: {
fontSize: '5.6rem',
}
}

@oliviertassinari oliviertassinari changed the title Using responsiveFontSizes results in inconsistency between <Typography> and <Box> Component [system] Using responsiveFontSizes results in inconsistency between <Typography> and <Box> Component Oct 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: system Specific to @mui/system
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants