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: Support light mode in nav #2522

Merged
merged 8 commits into from
Jul 26, 2024
Merged

refactor: Support light mode in nav #2522

merged 8 commits into from
Jul 26, 2024

Conversation

EnMod
Copy link
Contributor

@EnMod EnMod commented Jul 23, 2024

πŸ”— Relevant links

πŸ—’οΈ What

This PR refactors the nav and relevant children components to support light mode.

🀷 Why

This comes after a design team recommendation while working on other changes to the nav.

πŸ› οΈ How

My approach here was to leverage our existing tokens' ability to change based on the site theme, and use those tokens instead of hardcoded values in key areas. In some instances (e.g.: the .siteLogo SVG on the homepage and the logo on product pages), I added path fill overrides to change the SVGs' color when the theme changes.

πŸ“Έ Design Screenshots

There is no established spec for light mode at present; the preview has been approved by design.

πŸ§ͺ Testing

  • Open the preview link.
  • Go to the bottom of the page and change the theme to Dark.
  • Ensure text in the nav is legible, and contrasts with its background.
  • Ensure the site logo in the top-left contrasts with its background.
  • Switch the theme to Light, and perform the same validation steps.
  • Navigate to the product pages preview link, and perform the same validation steps.

πŸ’­ Anything else?

This work does change which text colors show up when switching to dark mode, but now the colors should be more aligned with our general design system.

Copy link

vercel bot commented Jul 23, 2024

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Comments Updated (UTC)
dev-portal βœ… Ready (Inspect) Visit Preview πŸ’¬ Add feedback Jul 24, 2024 4:40pm

Copy link

github-actions bot commented Jul 23, 2024

πŸ“¦ Next.js Bundle Analysis

This analysis was generated by the next.js bundle analysis action πŸ€–

This PR introduced no changes to the javascript bundle πŸ™Œ

@EnMod EnMod requested review from a team and nandereck and removed request for a team July 23, 2024 22:52
Copy link
Contributor

@nandereck nandereck left a comment

Choose a reason for hiding this comment

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

LGTM!

Comment on lines 103 to 115
/* @nest html[data-theme='light'] & {
&:active {
background-color: var(--token-color-foreground-primary);
}
}
} */

@nest html[data-theme='dark'] & {
/* @nest html[data-theme='dark'] & {
color: var(--token-color-foreground-strong);

&:hover, &[aria-expanded='true'] {
border-color: var(--token-color-border-strong);
}
}
} */
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need to comment this code out?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, I was testing whether we needed that code, and left that in before review πŸ˜… I'll double-check what's needed from it and remove in the next commit if I can (I should be able to) πŸ‘

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nandereck Removed the comments as of this commit (they were safe to remove):
eaf25cf

@EnMod EnMod merged commit 2e1a961 into main Jul 26, 2024
9 checks passed
@EnMod EnMod deleted the refactor/light-mode-nav branch July 26, 2024 19:55
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.

2 participants