-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
[ButtonGroup] Add support for CSS variables #32498
Conversation
|
I would say we should never care for the |
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.
👍 Love it!
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.
We still need to consider
...(ownerState.variant === 'text' &&
ownerState.orientation === 'vertical' && {
borderBottom: `1px solid ${
theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)'
}`,
}),
Yes, I do take it into account. Something like this quickly occurs to me, I don't know if it will be the approach to follow. I have doubts with the values for certain things... I'll leave them in [?] const light = theme.palette.mode === 'light'
let borderBottomColor = light ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)'
if (theme.vars) {
borderBottom = `rgba([?] / [?])`
} |
borderBottom: theme.vars | ||
? `1px solid rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` | ||
: `1px solid ${ | ||
theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)' | ||
}`, |
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.
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.
@siriwatknp Perfect! I'll check back later to make the change.
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.
I think I misunderstood the comment at first. 😅
backgroundChannel
and onBackgroundChannel
returns a color for dark/light?
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.
@vicasas yes.
light mode, --md-palette-common-backgroundChannel: 255 255 255;
.
dark mode, --md-palette-common-backgroundChannel: 0 0 0;
.
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.
Great! now it makes sense to me
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.
wait for the update to use onBackgroundChannel
.
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.
By bad, I looked at the wrong line 😂
one of #32049
Preview: https://deploy-preview-32498--material-ui.netlify.app/experiments/material-ui/button-group/