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

[docs] Fix Chakra UI theme scoping typo #36950

Merged
merged 1 commit into from
Apr 23, 2023

Conversation

mj12albert
Copy link
Member

@mj12albert mj12albert commented Apr 21, 2023

Just fixing a small typo discovered when trying to repro #36910

Proof that it works: https://codesandbox.io/s/chakra-material-forked-qsbpog?file=/src/App.tsx

Closes #36910

@mui-bot
Copy link

mui-bot commented Apr 21, 2023

Netlify deploy preview

Bundle size report

No bundle size changes

Generated by 🚫 dangerJS against 9c45712

@mj12albert mj12albert added the docs Improvements or additions to the documentation label Apr 21, 2023
@oliviertassinari oliviertassinari added the package: styled-engine Specific to @mui/styled-engine label Apr 21, 2023
@oliviertassinari
Copy link
Member

oliviertassinari commented Apr 21, 2023

I'm a bit confused by the API:

    <ChakraProvider theme={chakraTheme} resetCSS>
      <MaterialThemeProvider theme={{ [THEME_ID]: materialTheme }}>

Since ChakraProvider and MaterialThemeProvider share the theme React context singleton, I think that most developers should expect { [THEME_ID]: materialTheme } to override chakraTheme. Did we consider this API instead?

    <ChakraProvider theme={chakraTheme} resetCSS>
      <MaterialThemeProvider theme={{ [THEME_ID]: materialTheme }} mergeParentTheme>

or

    <ChakraProvider theme={chakraTheme} resetCSS>
      <MaterialThemeProvider theme={materialTheme} themeId={THEME_ID}>

I think either would be clearer. 2. might be better than 1.

@siriwatknp
Copy link
Member

siriwatknp commented Apr 23, 2023

@oliviertassinari Agree, (2) looks better and it should simplify the types. Will open an improvement.

@siriwatknp siriwatknp merged commit 7ed7cbf into mui:master Apr 23, 2023
@mj12albert mj12albert deleted the docs/chakra-theme-scoping branch April 24, 2023 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation package: styled-engine Specific to @mui/styled-engine
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Blank page when using Material UI with Chakra UI
4 participants