-
Notifications
You must be signed in to change notification settings - Fork 4k
[theming] Use dark mix for hovered color instead of theme.colors.secondaryBg
#10930
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
Conversation
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) ✅ license/snyk check is complete. No issues have been found. (View Details) |
✅ PR preview is ready!
|
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 did not change bgRowHovered on L122 since it's mixing the bg and secondaryBg colors dynamically. But we may want to revisit if this is the behavior we want.
theme.colors.secondaryBg
| // Whatever color we use here as the hover state, we want to transparentize it | ||
| // to its full extend, so you can see the underlying color of the menu. | ||
| backgroundColor: transparentize(theme.colors.secondaryBg, 1), | ||
| backgroundColor: transparentize(theme.colors.darkenedBgMix15, 1), |
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 color doesn't matter here with full transparency
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.
Can't we simiplfy this here and just use: `backgroundColor: "transparent"?
|
Two other hover-related places that would also be good to update:
export const ThemedStyledDropdownListItem = styled(StyledDropdownListItem, {
shouldForwardProp: isPropValid,
})(({ theme, $isHighlighted }) => {
return {
display: "flex",
alignItems: "center",
paddingTop: theme.spacing.none,
paddingBottom: theme.spacing.none,
paddingLeft: theme.spacing.lg,
paddingRight: theme.spacing.lg,
background: $isHighlighted ? theme.colors.darkenedBgMix15 : undefined,
// Override the default itemSize set on the component's JSX
// on mobile, so we can make list items taller and scrollable
[`@media (max-width: ${theme.breakpoints.md})`]: {
minHeight: theme.sizes.dropdownItemHeight,
height: "auto !important",
},
"&:hover, &:active, &:focus-visible": {
background: theme.colors.darkenedBgMix15,
},
}
})And maybe also update this one to use
|
837366a to
e5b9ef7
Compare
lukasmasuch
left a comment
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.
LGTM 👍
Describe your changes
The secondary background color (
theme.colors.secondaryBg,secondaryBackgroundColor...) has historically been used all over the places as a simple way to differentiate an element from the app's background color.This however made it difficult to articulate its purpose when defining custom theming options and we want to gradually revamp it into separated use cases more clearly.
This PR moved all hover (highlight) use cases of the
theme.colors.secondaryBgtotheme.colors.darkenedBgMix15to make it more consistent with the rest of the theming (Note that they are not the exact same gray but are very similar)GitHub Issue Link (if applicable)
Testing Plan
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.