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 is not defined" Error in @mui/material v6 sx Prop When Using pigment-css #43524

Closed
wh5938316 opened this issue Aug 30, 2024 · 2 comments
Closed
Labels
package: pigment-css Specific to @pigment-css/* status: expected behavior Does not imply the behavior is intended. Just that we know about it and can't work around it support: question Community support but can be turned into an improvement

Comments

@wh5938316
Copy link

wh5938316 commented Aug 30, 2024

Steps to reproduce

This works fine:

<Button
    variant='contained'
    sx={theme => ({
      bgcolor: theme.palette.common.black,
    })}
>
    Test
</Button>

However, this throws an error:

<Button
    variant='contained'
    sx={{
      bgcolor: theme => theme.palette.common.black,
    }}
>
    Test
</Button>

I would like to know if this behavior is intentional or if it’s a bug.

Current behavior

No response

Expected behavior

No response

Context

No response

Your environment

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Search keywords: pigment-css, v6

@wh5938316 wh5938316 added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Aug 30, 2024
@siriwatknp
Copy link
Member

Yes, it's intended. Theme callback should not be a value of a CSS property.

@siriwatknp siriwatknp added status: expected behavior Does not imply the behavior is intended. Just that we know about it and can't work around it package: pigment-css Specific to @pigment-css/* support: question Community support but can be turned into an improvement and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Aug 30, 2024
Copy link

This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

Note

We value your feedback @wh5938316! How was your experience with our support team?
If you could spare a moment, we'd love to hear your thoughts in this brief Support Satisfaction survey. Your insights help us improve!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: pigment-css Specific to @pigment-css/* status: expected behavior Does not imply the behavior is intended. Just that we know about it and can't work around it support: question Community support but can be turned into an improvement
Projects
Status: Done
Development

No branches or pull requests

2 participants