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

ToggleGroupControl: fix unselected icon color #44575

Merged
merged 3 commits into from
Sep 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- `Popover`: fix limitShift logic by adding iframe offset correctly [#42950](https://github.com/WordPress/gutenberg/pull/42950)).
- `Popover`: refine position-to-placement conversion logic, add tests ([#44377](https://github.com/WordPress/gutenberg/pull/44377)).
- `ToggleGroupControl`: adjust icon color when inactive, from `gray-700` to `gray-900` ([#44575](https://github.com/WordPress/gutenberg/pull/44575)).
- `TokenInput`: improve logic around the `aria-activedescendant` attribute, which was causing unintended focus behavior for some screen readers ([#44526](https://github.com/WordPress/gutenberg/pull/44526)).

### Internal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ exports[`ToggleGroupControl should render correctly with icons 1`] = `
}

.emotion-15 {
color: #1e1e1e;
width: 30px;
padding-left: 0;
padding-right: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,6 @@ export const buttonView = css`
}
`;

export const buttonActive = css`
color: ${ COLORS.white };
&:active {
background: transparent;
}
`;

export const ButtonContentView = styled.div`
font-size: ${ CONFIG.fontSize };
line-height: 1;
Expand All @@ -82,8 +75,17 @@ export const isIcon = ( {
};

return css`
color: ${ COLORS.gray[ 900 ] };
width: ${ iconButtonSizes[ size ] };
padding-left: 0;
padding-right: 0;
`;
};

export const buttonActive = css`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved buttonActive styles after the isIcon styles, so that the active color will still take precedence (thus making the icon's color white when it's selected/active)

color: ${ COLORS.white };

&:active {
background: transparent;
}
`;