Skip to content

Commit

Permalink
Fix active state styling for tertiary button (#2259)
Browse files Browse the repository at this point in the history
## Summary:
Use the same theme token for the height of the underline on the active state of the tertiary button so that the hover and active styling are consistent

Issue: WB-1025

## Test plan:
- Confirm that the hover and active state of the tertiary button have a consistent underline thickness

## Screen Recording:
Before & After

https://github.com/Khan/wonder-blocks/assets/14334617/2ce3725e-48f1-49f8-a111-761d1ce48944

Author: beaesguerra

Reviewers: beaesguerra, jandrade

Required Reviewers:

Approved By: jandrade

Checks: ✅ codecov/project, ✅ Test (ubuntu-latest, 20.x, 2/2), ✅ Test (ubuntu-latest, 20.x, 1/2), ✅ Check build sizes (ubuntu-latest, 20.x), ✅ Lint (ubuntu-latest, 20.x), ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ Prime node_modules cache for primary configuration (ubuntu-latest, 20.x), ✅ gerald, ✅ Chromatic - Get results on regular PRs (ubuntu-latest, 20.x), ✅ Check build sizes (ubuntu-latest, 20.x), ✅ Test (ubuntu-latest, 20.x, 2/2), ✅ Lint (ubuntu-latest, 20.x), ✅ Test (ubuntu-latest, 20.x, 1/2), ✅ Chromatic - Build on regular PRs / chromatic (ubuntu-latest, 20.x), ⏭️  Chromatic - Skip on Release PR (changesets), ⏭️  Publish npm snapshot, ✅ Prime node_modules cache for primary configuration (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ gerald, ⏭️  dependabot

Pull Request URL: #2259
  • Loading branch information
beaesguerra authored Jun 25, 2024
1 parent 0e616e4 commit 04a25ff
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/light-swans-thank.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@khanacademy/wonder-blocks-button": patch
---

Fix inconsistent underline height in the active state of the tertiary button.
2 changes: 1 addition & 1 deletion __docs__/wonder-blocks-button/button.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export const Tertiary: StoryComponentType = {
// eslint-disable-next-line testing-library/prefer-user-event
await fireEvent.mouseDown(button);
await expect(innerLabel).toHaveStyle("color: rgb(27, 80, 179)");
await expect(computedStyleLabel.height).toBe("1px");
await expect(computedStyleLabel.height).toBe("2px");
await expect(computedStyleLabel.color).toBe("rgb(27, 80, 179)");
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ export const _generateStyles = (
active: {
color: light ? fadedColor : activeColor,
":after": {
height: 1,
height: theme.size.height.tertiaryHover,
background: light ? fadedColor : activeColor,
},
},
Expand Down

0 comments on commit 04a25ff

Please sign in to comment.