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

Fix icon color on secondary and tertiary buttons (hover) #2297

Merged
merged 1 commit into from
Aug 22, 2024
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
5 changes: 5 additions & 0 deletions .changeset/small-walls-destroy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@khanacademy/wonder-blocks-button": patch
---

Fixes an issue on the icon color where it was using the incorrect value over dark backgrounds. The icon color now inherits the color from the button to preserve the same color defined for the text.
20 changes: 20 additions & 0 deletions __docs__/wonder-blocks-button/button.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,26 @@ const IconExample = () => (
</Button>
))}
</View>
<LabelLarge style={styles.label}>Over a dark background</LabelLarge>
<View
style={[
styles.row,
{backgroundColor: color.darkBlue, padding: spacing.medium_16},
]}
>
{kinds.map((kind, idx) => (
<Button
light={true}
kind={kind}
startIcon={pencilSimpleBold}
endIcon={plus}
style={styles.button}
key={idx}
>
{kind}
</Button>
))}
</View>
</View>
);

Expand Down
4 changes: 3 additions & 1 deletion packages/wonder-blocks-button/src/themes/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ const theme = {
* Icons
*/
icon: {
secondaryHover: tokens.color.blue,
// Allows the icon to be visible on hover in both light and dark
// backgrounds.
secondaryHover: "inherit",
},
},
border: {
Expand Down
Loading