-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
Failed to build Pigment CSS when both colorSchemes are provided #43183
Comments
Please create example repository with a reproduction that we can look into. Thanks! |
@siriwatknp I have tracked down this issue to the
In a nutshell - e = require('@emotion/serialize');
e.serializeStyles([{
'@media (prefers-color-scheme: dark) { :root': {
color: 'red'
}
}]) outputs @media (prefers-color-scheme: dark) { :root{color:red;} which is not a valid css. Instead, the selector should be broken down into nested objects like - e.serializeStyles([{
'@media (prefers-color-scheme: dark)': {
':root': {
color: 'red'
}
}
}]) which outputs the correct css - @media (prefers-color-scheme: dark){:root{color:red;}} |
@brijeshb42 here is the fix #43237. Note: |
Or it could be because |
@brijeshb42 I'd keep Pigment CSS like that until there is a strong reason to add |
Steps to reproduce
Link to live example: (required)
Steps:
Current behavior
The error only occurs when both colorSchemes are provided. If only one is defined, the project builds successfully.
Syntax error: [projectFolder]\node_modules.pnpm@mui+material-pigment-css@6.0.0-beta.0_@emotion+react@11.13.0_@types+react@18.2.74_react@19.0_jt4ujl3p5dkqkj3rnjygiu6ujm\node_modules@mui\material-pigment-css\styles.css Unclosed block
Expected behavior
Build without Failure
Context
No response
Your environment
npx @mui/envinfo
Search keywords: Pigment-CSS, NextJS-15, react-compiler
The text was updated successfully, but these errors were encountered: