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

[styles] Fix ThemeProvider requiring full theme #18500

Merged
merged 1 commit into from
Nov 22, 2019

Conversation

eps1lon
Copy link
Member

@eps1lon eps1lon commented Nov 22, 2019

A ThemeProvider merges the outer theme shallowly with the passed theme. Providing a partial theme is sufficient.

Future Work:

  • Use mui default theme as DefaultTheme in MuiThemeProvider generic.

@eps1lon eps1lon added typescript package: styles Specific to @mui/styles. Legacy package, @material-ui/styled-engine is taking over in v5. labels Nov 22, 2019
@eps1lon eps1lon force-pushed the fix/styles/ThemeProvider-partial branch from 108ce10 to 5483f0e Compare November 22, 2019 12:26
...defaultTheme,
palette: {
...defaultTheme.palette,
secondary: {
Copy link
Member Author

Choose a reason for hiding this comment

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

The merge is not deep which is now explicit with types. Fixes
Screenshot from 2019-11-22 13-21-55

Hovered:
Old
Screenshot from 2019-11-22 13-23-46
New
Screenshot from 2019-11-22 13-24-09

@mui-pr-bot
Copy link

No bundle size changes comparing 2b04ee9...5483f0e

Generated by 🚫 dangerJS against 5483f0e

@eps1lon eps1lon merged commit 7653673 into mui:master Nov 22, 2019
@eps1lon eps1lon deleted the fix/styles/ThemeProvider-partial branch November 22, 2019 19:22
eps1lon added a commit to eps1lon/material-ui that referenced this pull request Nov 25, 2019
eps1lon added a commit to eps1lon/material-ui that referenced this pull request Nov 25, 2019
eps1lon added a commit to eps1lon/material-ui that referenced this pull request Nov 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: styles Specific to @mui/styles. Legacy package, @material-ui/styled-engine is taking over in v5. typescript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants