Skip to content

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

@mbrookes mbrookes added breaking change Introduces changes that are not backward compatible. component: CssBaseline The React component. labels Dec 14, 2020
@mui-pr-bot
Copy link

mui-pr-bot commented Dec 14, 2020

Details of bundle changes

Generated by 🚫 dangerJS against 53e3f1c

@oliviertassinari oliviertassinari merged commit bd47246 into mui:next Dec 15, 2020
@mbrookes mbrookes deleted the cssbaseline-body-font branch December 15, 2020 21:43
@oliviertassinari oliviertassinari added this to the v5 milestone Dec 20, 2020
@oliviertassinari oliviertassinari mentioned this pull request Dec 20, 2020
42 tasks
@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

Labels

breaking change Introduces changes that are not backward compatible. component: CssBaseline The React component.

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