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

[DataGrid] Fix background colors when CSSVarsProvider is used #12901

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cherniavskii
Copy link
Member

Fixes #12855

@cherniavskii cherniavskii added bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! labels Apr 25, 2024
@mui-bot
Copy link

mui-bot commented Apr 25, 2024

Deploy preview: https://deploy-preview-12901--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against 7daeb20


const removeOpacity = (color: string) => `rgb(from ${color} r g b / 1)`;
function blendCssVars(background: string, overlay: string, opacity: number) {
return `color-mix(in srgb,${background}, ${removeOpacity(overlay)} calc(${opacity} * 100%))`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasn't sure if we could use color-mix. What are our supported browser versions?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to validate this approach.
color-mix requires iOS >= 16.2, while we currently support >= 15.4. Same for Safari on MacOS. Other browsers seem to match what we have in our browserslist.

Do you have other ideas for solving this issue?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this is the only thing that could work with CSS variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[data grid] inconsistent background of a cell when hovering on a row
3 participants