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

[theme] Rename type to mode #22687

Merged
merged 6 commits into from
Sep 22, 2020
Merged

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
@@ -310,7 +310,7 @@ function AppFrame(props) {
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants