Material-ui: Default font-size of `body` is `0.875rem` when using CssBaseline

Created on 18 Nov 2019  路  3Comments  路  Source: mui-org/material-ui

  • [x] The issue is present in the latest release.
  • [x] I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 馃槸

After upgrading from v3 to v4 of material ui, the font size of our entire application has changed, and the default is now 0.875rem

Expected Behavior 馃

I would expect that the default font size is 1rem

Steps to Reproduce 馃暪

https://codesandbox.io/s/clever-poitras-x70t9

Screen Shot 2019-11-18 at 2 49 09 PM

duplicate

Most helpful comment

For anyone else that has this problem, I was able to add the following to the theme object as a workaround:

const theme = createMuiTheme({
  typography: {
    body2: {
      fontSize: "1rem"
    }
  }
});

All 3 comments

@jim-moody Thanks for the report.
It's a duplicate of #17100.

For anyone else that has this problem, I was able to add the following to the theme object as a workaround:

const theme = createMuiTheme({
  typography: {
    body2: {
      fontSize: "1rem"
    }
  }
});

For anyone else who tries the above and it does not work. You need to ensure that CssBaseline is placed after MuiThemeProvider E.g.

 <MuiThemeProvider theme={theme}>
      <CssBaseline />
 </MuiThemeProvider>
Was this page helpful?
0 / 5 - 0 ratings