-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[Joy] Add default color to Input
and ListItemButton
#31826
Conversation
@mui/joy: parsed: +2.20% , gzip: +0.79% |
outlinedHoverBg: 'var(--joy-palette-neutral-outlinedHoverBg)', | ||
outlinedHoverBorder: 'var(--joy-palette-neutral-outlinedHoverBorder)', | ||
outlinedActiveBg: 'var(--joy-palette-neutral-outlinedActiveBg)', | ||
outlinedDisabledColor: 'var(--joy-palette-neutral-outlinedDisabledColor)', | ||
outlinedDisabledBorder: 'var(--joy-palette-neutral-outlinedDisabledBorder)', | ||
lightColor: 'var(--joy-palette-neutral-lightColor)', | ||
lightBg: 'var(--joy-palette-neutral-lightBg)', | ||
lightHoverColor: 'var(--joy-palette-neutral-lightHoverColor)', |
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.
Are we intentionally not having containedHoverColor
?
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 @danilo-leal will tweak the colors again.
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 will!
@@ -143,7 +143,7 @@ const Avatar = React.forwardRef(function Avatar(inProps, ref) { | |||
color = 'neutral', | |||
component = 'div', | |||
size = 'md', | |||
variant = 'contained', | |||
variant = '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.
Is there a reason for this?
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.
One intention of the global variant is to bring attention. Currently contained
brings the most attention and text
be the last. My feeling is that Avatar is a complimentary UI, so it should not be contained
by default.
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.
Gottcha gottcha!
sx?: SxProps; | ||
}; | ||
props: P & | ||
SystemProps & { |
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 like this!
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 missed this type in the Typography PR.
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.
Looks good! Yep, I agree with the motivation behind the PR.
Why?
The current implementation allows some components to have a variant without a color. However, for Input & ListItemButton, they are interactive which need colors on hover, active, disabled. At initial state, they use
text.primary
color and use theneutral
color for other states if the color prop isundefined
. I think it creates confusion for customization and developers will have to remember about these specific components.I think it would be better to just use neutral color directly and does not allow any components to have a variant without a color (for the default case).
Changes
neutral
variant tokens to have higher contrastInput
&ListItemButton
to haveneutral
color by default<Typography color="primary.textColor" fontWeight="sm">