-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
Bump @mui/monorepo digest to 61c3cc9 #17062
base: master
Are you sure you want to change the base?
Conversation
Thanks for adding a type label to the PR! 👍 |
Deploy preview: https://deploy-preview-17062--material-ui-x.netlify.app/ |
🤔 Not sure why argos is failing. I don't think it's related to the monorepo? |
It's just flaky CI 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, thanks for addressing the theme and RTL switching performance and issues. 🙌 💯
I added a fix for this demo. It's the only one I found with dark theme issue https://deploy-preview-17062--material-ui-x.netlify.app/x/react-data-grid/features/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking care of it
I noticed some theme.applyStyle('dark', { ... })
and theme.applyDarkStyle({ ... })
is their one to prefer compare to the other?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good spot @alexfauquette! 👍
Here are some other problematic cases after a thorough checking:
- https://deploy-preview-17062--material-ui-x.netlify.app/x/react-data-grid/row-height/#row-spacing
- https://deploy-preview-17062--material-ui-x.netlify.app/x/react-data-grid/editing/#apiref
- https://deploy-preview-17062--material-ui-x.netlify.app/x/react-data-grid/components/toolbar/#custom-elements
- opening https://deploy-preview-17062--material-ui-x.netlify.app/x/react-date-pickers/custom-field/ forces a light theme
- https://deploy-preview-17062--material-ui-x.netlify.app/x/react-date-pickers/custom-field/#using-joy-ui
- https://deploy-preview-17062--material-ui-x.netlify.app/x/react-charts/styling/#overlay (both section demos)
- https://deploy-preview-17062--material-ui-x.netlify.app/x/react-charts/styling/#css
- https://deploy-preview-17062--material-ui-x.netlify.app/x/react-tree-view/simple-tree-view/customization/#gmail-clone
- All inputs are white when edit mode is triggered: https://deploy-preview-17062--material-ui-x.netlify.app/x/react-tree-view/rich-tree-view/editing/
- Borked theme: https://deploy-preview-17062--material-ui-x.netlify.app/x/react-date-pickers/date-picker/#customization
This demo in general needs dark theme adjustments: https://next.mui.com/x/react-data-grid/style/#striped-rows
@siriwatknp do you have time to fix these or should we split the fixes among the team? 🤔
This is not the first time we have had dark theme visual regressions, which need manual checking. 🙈 |
We would need to check if it's ok to double the price with @oliviertassinari Those error only occurs in specific PR (like this one) when we impact how the light/dark mode is handled by the docs. If it was possible to manually trigger a screenshot from master and the current branch to compare them in dark mode, I would do it. But doing that for all PRs looks overkill |
I can fix it one by one, thank you so much for the list @alexfauquette @LukasTy |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
The root cause seems to be the fact that |
@@ -77,15 +82,19 @@ const CustomTreeItem = React.forwardRef(function CustomTreeItem(props, ref) { | |||
status, | |||
} = useTreeItem({ id, itemId, children, label, disabled, rootRef: ref }); | |||
|
|||
const style = { | |||
'--tree-view-color': theme.palette.mode !== 'dark' ? color : colorForDarkMode, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This solution could still work if theme.palette.mode
returned the actual mode set on docs... 🙈 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea is to delegate the light/dark to CSS only. Otherwise, when you update the theme mode all the Demo ThemeProvider will re-render.
The new Demo theme provider that erase custom theme tokens:
If some packages plan to have demo that do not support CSS-vars we could have a dedicated Demo wrapper that pass the mode token with something like
{{"demo": "NeedThemeToken.js", "notCSSVarsCompatible": true }}
Yeah, let's not check all the images, this sounds really slow for the CI time to complete. Actually, thinking about it, we might as well consider how to be more efficient: mui/mui-public#290. We could have one dark mode test, one that makes sure that the dark/light mode integration is not all broken. |
@LukasTy @alexfauquette 2 things that are not working
I'm fixing both from the core side. I think ideally, there should be no change in this PR, if you are okay I would like to revert the changes after fixing the code side. |
I'm ok. I extracted the olny modification that is not docs only related #17106 But we will need to find a solution to those issues if we want to remove the |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
@LukasTy @alexfauquette Updated the monorepo with mui/material-ui#45661 and the fix on MUI System, both of these are fixed!
Let me refine a bit and add visual regression tests in mui/material-ui#45661, will let you know when this PR is ready for the final review. |
https://deploy-preview-17062--material-ui-x.netlify.app/x/react-data-grid/components/toolbar/#custom-elements looks problematic again after the latest changes. |
- https://mui.com/system/styles/advanced/ | ||
- https://mui.com/system/styles/advanced/#class-names | ||
- https://mui.com/system/styles/advanced/#server-side-rendering | ||
- https://mui.com/system/styles/advanced/#theme-nesting | ||
- https://mui.com/system/styles/api/#creategenerateclassname-options-class-name-generator | ||
- https://mui.com/system/styles/api/#stylesprovider | ||
- https://mui.com/system/styles/api/#themeprovider | ||
- https://mui.com/system/styles/basics/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These probably need updating on the mui/material-ui
repo side. 🤔
cc @mui/core
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
already on it mui/material-ui#45677
This bump fixes the dark mode flicker for MUI X docs.
All MUI X pages now use CSS theme variables.