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

[CssBaseline] Change body font size to body1 (1rem) #24018

Merged
merged 2 commits into from
Dec 15, 2020

Conversation

mbrookes
Copy link
Member

@mbrookes mbrookes commented Dec 14, 2020

Breaking changes

  • [CssBaseline] The body font size has changed from theme.typography.body2 (0.875rem) to theme.typography.body1 (1rem).
    To return to the previous size, you can override it in the theme:

    const theme = createMuiTheme({
      components: {
        MuiCssBaseline: {
          styleOverrides: {
            body: {
              fontSize: '0.875rem',
              lineHeight: 1.43,
              letterSpacing: '0.01071em',
            },
          },
        },
      },
    })

    (Note that this will also affect use of the Typography component with the default body1 variant).


Closes #17100
Part of #20012

@mui-pr-bot
Copy link

mui-pr-bot commented Dec 14, 2020

Details of bundle changes

Generated by 🚫 dangerJS against 53e3f1c

@ed-sparkes
Copy link

is this a v5 feature, is it not a bug that should be patched on v4?

@oliviertassinari
Copy link
Member

@ed-sparkes it's a bug, but also a breaking change, so it was handled in v5.

@charlielow
Copy link

For v4 I worked around this by applying a global override and patching in body2 styles, ex.

const theme = createMuiTheme({
  overrides: {
    MuiCssBaseline: {
      '@global': {
        body: {
          fontSize: '0.875rem',
        },
      },
    },
  },
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Applying body2 styling to the body element causes weird behavior that can't be overriden
5 participants