-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[data grid] How to change DataGrid Palette colors #12443
Comments
For the time being you can use Waiting for feedback from the rest of the team, but we'll probably be adding shortly a more formal method to override the style variables. |
Perfect! Thank you, @romgrk ! |
Hey @sydneyjodon-wk ... there are actually 2 more ways to accomplish this:
@romgrk the pinned rows do not get a class applied that shows that they are pinned so we cannot target that. Is that intentional? I have updated your example here Would that be suficient for you? |
Thank you, @michelengelen - yes, it looks like updating using style overrides to override those variables will work for us - I didn't know you could do that! Thank you! Like @romgrk mentioned, the hover state still gets the |
Not for now, you'd need to add the hover/selected styles yourself. We'll update here as soon as we have a better styling solution. |
I have opened #12614, the customization API would look something like this. If you have any comments feel free to share. |
@sydneyjodon-wk: 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. |
The problem in depth
Hello 馃憢
Is there a way to change the DataGrid theme palette colors similar to how you can change component theme palette colors in other MUI components (i.e. for
Alert
you can changetheme.palette.Alert.infoFilledBg
)?I specifically would like to change some of these variables in
gridStyle
- likecontainerBackground
andpinnedBackground
because our theme uses a different color fortheme.palette.background.default
, but we don't want the DataGrid header row or pinned rows/columns to be updated to that color:Is there a way to override these colors? Either through setting a palette variable specifically for DataGrid or some other way? We tried using style overrides to override the color, but we're having trouble finding each element to style override since the variable is used in so many places.
FYI this is in MUI-X
v7 (next)
Here is a codesandbox demo of the same issue - https://codesandbox.io/p/sandbox/datagrid-palette-colors-example-575y79?file=%2Fsrc%2FDemo.tsx%3A52%2C9
Thank you!
Search keywords: palette, pinnedBackground, containerBackground
Order ID: 82849
The text was updated successfully, but these errors were encountered: