Skip to content

fix: update card borderRadius and related tests - #3441

Merged
LinKCoding merged 2 commits into
mainfrom
kl-interactive-card-resolve-border-radius
Oct 13, 2026
Merged

LinKCoding merged 2 commits into
mainfrom
kl-interactive-card-resolve-border-radius

Conversation

@LinKCoding

@LinKCoding LinKCoding commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Overview

Card hover animations now use the border radius of the active theme, so switching themes updates the radius instead of keeping the previously computed one.

  • useCardElevation (packages/gamut/src/Card/styles.tsx) reads borderRadii from useTheme() instead of receiving a radius already resolved from the static core scale in @codecademy/gamut-styles.
  • The hook takes the Card's borderRadius token. It resolves string values through the theme's scale and passes through any other string. Responsive or function values resolve to undefined, because framer-motion needs a concrete value to animate.
  • Card (packages/gamut/src/Card/index.tsx) passes the token to the hook and drops its own static lookup and the borderRadii import.
  • Card.test.tsx now checks that borderRadius resolves from the active theme for coreTheme, percipioTheme and lxStudioTheme.

PR Checklist

  • Related to designs:
  • Related to JIRA ticket: [ABC-123]
  • Version plan added/updated (or not needed)
  • I have run this code to verify it works
  • This PR includes unit tests for the code change
  • This PR includes testing instructions tests for the code change
  • The alpha package of this PR is passing end-to-end tests in all relevant Codecademy repositories

Testing Instructions

Don't make me tap the sign.

  1. Open the Card stories in Storybook with the default (core) theme and hover an interactive Card. Note the corner radius (md is 4px).
  2. Switch the theme to LX Studio (or another theme with a different radius scale). Hover the same Card and check that the radius follows the new theme (LX Studio md is 8px).
  3. Set a different borderRadius token (e.g. lg, xl) on an interactive Card and repeat the theme switch. Check that the radius updates each time.
  4. Check the patternLeft, patternRight and outline shadow variants on hover. The radius should stay correct while the shadow animates.
  5. ...
  6. Celebrate

PR Links and Envs

Repository PR Link
Mono Mono PR
Monolith Monolith PR

@nx-cloud

nx-cloud Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit e4aafbf


☁️ Nx Cloud last updated this comment at 2026-10-12 19:53:54 UTC

@codecov

codecov Bot commented Oct 12, 2026

Copy link
Copy Markdown

⚠️ JUnit XML file not found

The CLI was unable to find any JUnit XML files to upload.
For more help, visit our troubleshooting guide.

@codecademydev

Copy link
Copy Markdown
Collaborator

📬 Published Alpha Packages:

Package Version npm Diff
@codecademy/gamut 73.6.3-alpha.7e3569.0 npm diff
@codecademy/gamut-icons 10.2.1-alpha.7e3569.0 npm diff
@codecademy/gamut-illustrations 1.1.1-alpha.7e3569.0 npm diff
@codecademy/gamut-kit 3.0.26-alpha.7e3569.0 npm diff
@codecademy/gamut-patterns 1.1.1-alpha.7e3569.0 npm diff
@codecademy/gamut-styles 21.2.1-alpha.7e3569.0 npm diff
@codecademy/gamut-tests 7.1.1-alpha.7e3569.0 npm diff
@codecademy/variance 1.1.1-alpha.7e3569.0 npm diff
eslint-plugin-gamut 3.1.1-alpha.7e3569.0 npm diff

@github-actions

Copy link
Copy Markdown
Contributor

@LinKCoding
LinKCoding marked this pull request as ready for review October 12, 2026 20:24
@LinKCoding
LinKCoding requested a review from a team as a code owner October 12, 2026 20:24

@aresnik11 aresnik11 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@LinKCoding
LinKCoding merged commit 99a181e into main Oct 13, 2026
14 checks passed
@LinKCoding
LinKCoding deleted the kl-interactive-card-resolve-border-radius branch October 13, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants