Skip to content

[theme] Rename type to mode#22687

Merged
mnajdova merged 6 commits intomui:nextfrom
mnajdova:feat/theme-type-to-mode
Sep 22, 2020
Merged

[theme] Rename type to mode#22687
mnajdova merged 6 commits intomui:nextfrom
mnajdova:feat/theme-type-to-mode

Conversation

@mnajdova
Copy link
Member

@mnajdova mnajdova commented Sep 21, 2020

Breaking changes

  • Renames theme.palette.type to theme.palette.mode, to better follow the "dark mode" term that is usually used for describing this feature.

    import { createMuiTheme } from '@material-ui/core/styles';
    
    -const theme = createMuitheme({palette: { type: 'dark' }}),
    +const theme = createMuitheme({palette: { mode: 'dark' }}),

    The changes are supported by the adaptV4Theme() for easing the migration


Part of #20012

@mui-pr-bot
Copy link

mui-pr-bot commented Sep 21, 2020

Details of bundle changes

Generated by 🚫 dangerJS against 9fba300

@mnajdova mnajdova marked this pull request as ready for review September 21, 2020 17:41
@mnajdova mnajdova added the breaking change Introduces changes that are not backward compatible. label Sep 21, 2020
data-ga-event-category="header"
data-ga-event-action="dark"
>
{theme.palette.type === 'light' ? <Brightness4Icon /> : <Brightness7Icon />}
Copy link
Member

@mbrookes mbrookes Sep 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That reminds me (and completely incidental to this PR), but we should really provide an option to return to the browser / system setting. At the moment, once a cookie is set, the mode is fixed.

@mbrookes mbrookes added this to the v5 milestone Sep 22, 2020
Copy link
Member

@oliviertassinari oliviertassinari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants