-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
[bug] The styled
function does not work with MUI system
#36
Comments
styled
does not work with MUI systemstyled
function does not work with MUI system
Can't we use the |
I believe I am hitting something similar... I am building a new next.js react app using app router and React Server Components. I found this awesome library and all the MUI - nextjs stuff that is coming together. I'm taking a gamble that MUI v6 with pigment-css will be released about the same time that I need it for this project (end of year 2024). To see an example, I have created an app here: https://codesandbox.io/p/devbox/lively-snowflake-jc79t8 In this app, I have my layout, page and applicationHeader component all setup as RSC with appropriate styles, etc. I then embed a userProfileDropdown SSR / client component that uses material-ui emotion theming. All of this seems to work fine, styles seem to be applied correctly in both RSC and client components. However, I'm hitting an error when trying to reference Material-UI theme values directly. For example, my menu component will often be displayed inside modals, therefore, we bump up the z-index on the menu component to display correctly once in a modal. To do this, we grab the I'm hitting a build error, because it is unable to find that value in my pigment-css theme. Is there a way to setup my application so that the pigment-css theme merges the material-ui theme, or can tell the build engine to ignore the material-ui theme variables? The build error is:
|
Steps to reproduce
See https://github.com/mui/material-ui/actions/runs/8837080528/job/24265117421?pr=41663 in mui/material-ui#41663
Current behavior
ownerState
is undefined inInputBase
styles whenFilledInput
(Pigment) is wrappingInput
(MUI System).The root cause is that FilledInputRoot does not forward
ownerState
to InputBase which causes an error from the InputBase.Expected behavior
They should work together, both MUI System wrappin Pigment or Pigment wrapping MUI System.
Context
Found this issue when trying to migrate only FilledInput to support Pigment CSS.
Your environment
npx @mui/envinfo
Search keywords: styled
The text was updated successfully, but these errors were encountered: