Closed Methuselah96 closed 2 weeks ago
This is expected, Pigment CSS only has access to the CSS vars, this is how it's possible not to depend on context for the theme. @brijeshb42 correct me if I am wrong please.
We should likely point this out in the migration guide tough @siriwatknp
Sounds good, I wasn't sure if it was a bug or just something missing in the migration guide. It took a few hours to figure out what was going on though, so I'm sure others would appreciate it getting added to the migration guide. I couldn't figure out what the issue was until I took a look at the example project in examples/material-ui-pigment-css-vite-ts
.
Yes. It is expected. Thanks for flagging @Methuselah96. We'll get it added to the docs.
@brijeshb42 This is strange. I'd expect it to work without CSS variables.
So the issue here seems to be more than the null value. I was able to fix the issue with null
but then, I am facing other issues related to using the theme during runtime, mainly useTheme()
calls.
I'll post an update when I have a fix.
I tested the provided sandbox with the latest version of Pigment CSS and Material UI, it project works fine so this issue is closed.
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] @Methuselah96 How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.
Steps to reproduce
Link to live example: https://stackblitz.com/edit/github-gwqtwf?file=src%2FApp.tsx,vite.config.ts
Note that this only happens if
cssVariables
is not set withincreateTheme
invite.config.ts
.Current behavior
The build crashes with these errors:
Expected behavior
Everything works
Context
I am experimenting with migrating to Pigment CSS using the migration guide and ran into these errors. I can fix it by adding
cssVariables: true
increateTheme
invite.config.ts
, but I did not see that mentioned in the migration guide, so I'm assuming this is a bug.Your environment
``` System: OS: Windows 11 10.0.22631 Binaries: Node: 20.11.1 - C:\Program Files\nodejs\node.EXE npm: 10.2.4 - C:\Program Files\nodejs\npm.CMD pnpm: 9.9.0 - C:\Program Files\nodejs\pnpm.CMD Browsers: Chrome: Not Found Edge: Chromium (127.0.2651.74) ```npx @mui/envinfo
Search keywords: filledinput outlinedinput pigment css