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

[Checkbox] Add support for CSS variables #32579

Merged
merged 7 commits into from
Jun 7, 2022
Merged

[Checkbox] Add support for CSS variables #32579

merged 7 commits into from
Jun 7, 2022

Conversation

haneenmahd
Copy link
Contributor

@haneenmahd haneenmahd commented May 3, 2022

Support for CSS variables with <CheckBox />

@haneenmahd haneenmahd marked this pull request as draft May 3, 2022 12:31
@haneenmahd haneenmahd marked this pull request as ready for review May 3, 2022 12:32
@mui-bot
Copy link

mui-bot commented May 3, 2022

Details of bundle changes

Generated by 🚫 dangerJS against 8881da1

@haneenmahd
Copy link
Contributor Author

@siriwatknp

These images below represent the change in their hover background when I switched to using theme.vars according to documentation on #32049. But the hover background of these checkboxes differ from each other.

Using theme.vars
Screenshot 2022-05-03 at 5 55 08 PM

Not using theme.vars
Screenshot 2022-05-03 at 5 54 33 PM

Can you please explain what's going on here wrong with my code?

theme.palette.action.hoverOpacity,
),
backgroundColor: theme.vars
? `rgba(${theme.vars.palette.text.primaryChannel} / ${theme.vars.palette.action.hoverOpacity})`
Copy link
Member

Choose a reason for hiding this comment

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

You need to add here too the check for the ownerState.color that you have below.

Copy link
Member

@siriwatknp siriwatknp May 4, 2022

Choose a reason for hiding this comment

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

We don't have action.activeChannel yet, seems like we have to add it or find other alternatives.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have fixed the hover background color by applying using palette.primary.mainChannel and palette.action.hoverOpacity.

How do I do the check for ownerState.color, I didn't understand that part ?

Copy link
Member

Choose a reason for hiding this comment

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

It's the same as in #32599 (comment), let's wait for it to be resolved there and we can fix it in this PR too.

Copy link
Member

Choose a reason for hiding this comment

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

Note, I just merged #32599. Feel free to rebase and you will have the activeChannel in your theme.

@mnajdova
Copy link
Member

mnajdova commented May 3, 2022

These images below represent the change in their hover background when I switched to using theme.vars according to documentation on #32049. But the hover background of these checkboxes differ from each other.

Can you please explain what's going on here wrong with my code?

See #32579 (comment)

@danilo-leal danilo-leal added component: checkbox This is the name of the generic UI component, not the React module! new feature New feature or request labels May 3, 2022
Copy link
Member

@siriwatknp siriwatknp left a comment

Choose a reason for hiding this comment

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

👍 Thanks for working on it! We're one step to the finish line.

@siriwatknp siriwatknp merged commit 0bbc7fd into mui:master Jun 7, 2022
@siriwatknp siriwatknp mentioned this pull request Jun 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: checkbox This is the name of the generic UI component, not the React module! new feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants