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

refactor(Color): Update shadow tokens' names and values #3036

Merged
merged 9 commits into from
Feb 19, 2025
Merged

Conversation

LinKCoding
Copy link
Contributor

@LinKCoding LinKCoding commented Feb 11, 2025

Overview

Updating the names of shadow tokens (colors that use shadow-*) and updating components that have been using shadow-* tokens incorrectly, i.e. not semantically correct, like setting a background to shadow-solid instead of background-contrast.

Note:

  1. Not all components in Monorepo actually need to be viewed, see the link provided below for more info
  2. There's nothing in Monolith that uses shadow tokens, but the PR is included to check against the alpha package just in case.

PR Checklist

  • Related to JIRA ticket: GM-990
  • I have run this code to verify it works
  • The alpha package of this PR is passing end-to-end tests in all relevant Codecademy repositories

Testing Instructions

For Gamut:

  1. Check ?path=/docs/foundations-colormode--docs to see that shadow-solid is now shadow-primary and shadow-opaque is now shadow-secondary.
  2. Compare the current version of Card against the preview/local (?path=/docs/atoms-card--docs#shadow-variants). Check that the functionality is the same and the colors are similar.
  3. Compare the current version of Form's Checkbox against the preview/local (?path=/docs/atoms-forminputs-checkbox--docs&globals=viewport:responsive#usage) — the color of the polyline should be roughly the same.
  4. Compare the current version of the Tab's block variant with against the preview/local(?path=/docs/molecules-tabs--docs#block-variant) — the bg should still be similar.
  5. Compare the current version of Overlay with against the preview/local (?path=/docs/molecules-modals-overlay--docs) — the shroud should be similar
  6. (Optionally) compare ModalDeprecated](https://gamut.codecademy.com/?path=/docs/molecules-modals-modaldeprecated--docs) against preview/local (?path=/docs/molecules-modals-modaldeprecated--docs)
  7. ...
  8. Profit!

PR Links and Envs

Repository PR Link PR Env
Monolith Monolith PR Monolith Env
Mono/LE Mono Link Portal Env
Mono/Portal App Mono Link LE Env

Copy link

nx-cloud bot commented Feb 11, 2025

View your CI Pipeline Execution ↗ for commit e64de76.


☁️ Nx Cloud last updated this comment at 2025-02-19 13:31:40 UTC

@@ -129,7 +129,7 @@ export const coreTheme = createTheme({
},
},
})
.addScale('borders', ({ colors }) => ({
.addScale('borders', ({ colors }: { colors: Record<string, string> }) => ({
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this ok? TS was complaining that colors was implicitly typed as any (and this is what Copilot suggested) .

@LinKCoding LinKCoding changed the title fix(Color): Update shadow tokens' names and values refactor(Color): Update shadow tokens' names and values Feb 13, 2025
@LinKCoding LinKCoding marked this pull request as ready for review February 13, 2025 18:16
@LinKCoding LinKCoding requested a review from a team as a code owner February 13, 2025 18:16
@@ -28,20 +28,20 @@ const DynamicCardWrapper = styled(Box)<CardWrapperProps>(
prop: 'shadow',
base: {
position: 'relative',
boxShadow: `0px 0px 0 currentColor`,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wondering if it's actually better to remove this altogether?
it seems like values for no shadow?

Copy link
Contributor

Choose a reason for hiding this comment

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

aere we sure shadow actually get overwritten when this value is removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Double checked on local + preview by removing the code and I don't see any visible difference for shadow

@@ -54,20 +54,20 @@ const shadowVariants = (mode: ColorModes) =>
prop: 'shadow',
base: {
position: 'relative',
boxShadow: `0px 0px 0 currentColor`,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

same thought here on removal?

Copy link
Contributor

@dreamwasp dreamwasp left a comment

Choose a reason for hiding this comment

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

love it, looks greata!

@codecademydev
Copy link
Collaborator

📬Published Alpha Packages:

@codecademy/[email protected]
@codecademy/[email protected]
@codecademy/[email protected]
@codecademy/[email protected]
@codecademy/[email protected]
@codecademy/[email protected]
@codecademy/[email protected]

@codecademydev
Copy link
Collaborator

🚀 Styleguide deploy preview ready!

https://67b5dd49271da86210c100da--gamut-preview.netlify.app

Deploy Logs

@LinKCoding LinKCoding added the Ship It :shipit: Automerge this PR when possible label Feb 19, 2025
@codecademydev codecademydev merged commit c9ffecc into main Feb 19, 2025
18 of 19 checks passed
@codecademydev codecademydev removed the Ship It :shipit: Automerge this PR when possible label Feb 19, 2025
@codecademydev codecademydev deleted the kl-gm-990 branch February 19, 2025 13:33
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