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

IconButton: color override not applied for medium size #4863

Closed
cbix opened this issue Aug 20, 2024 · 2 comments · Fixed by #4989
Closed

IconButton: color override not applied for medium size #4863

cbix opened this issue Aug 20, 2024 · 2 comments · Fixed by #4989
Assignees

Comments

@cbix
Copy link

cbix commented Aug 20, 2024

Description

Works:

<IconButton icon={InboxIcon} aria-label="Notifications" size="small" sx={{ color: 'green' }} />
<IconButton icon={InboxIcon} aria-label="Notifications" size="large" sx={{ color: 'green' }} />

Doesn't work:

<IconButton icon={InboxIcon} aria-label="Notifications" size="medium" sx={{ color: 'green' }} />
<IconButton icon={InboxIcon} aria-label="Notifications" sx={{ color: 'green' }} />

The default style rule takes precedence over the override in this case:

.bIJAok[data-component="IconButton"][data-no-visuals] {
    color: var(--fgColor-muted, var(--color-fg-muted, #656d76));
}
.bIJAok[data-no-visuals] {
    color: green;
}

While for small/large buttons it has extra specificity:

.LLQDD[data-size="small"][data-no-visuals] {
    color: green;
}
.LLQDD[data-component="IconButton"][data-no-visuals] {
    color: var(--fgColor-muted, var(--color-fg-muted, #656d76));
}

Steps to reproduce

  1. Render a default IconButton with a color override

Version

v36.27.0

Browser

Chrome

@cbix cbix added the bug Something isn't working label Aug 20, 2024
@lesliecdubs
Copy link
Member

Hi, thanks for reporting this!

I'm tagging this into our design team's board to confirm whether this is expected/desired behavior or not.

@lesliecdubs lesliecdubs added design and removed react labels Aug 26, 2024
@tallys
Copy link

tallys commented Sep 3, 2024

@lesliecdubs this is a css specificity issue, no objection to fixing for consistency 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants