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: menu color tokens #13926

Merged
merged 2 commits into from
Sep 23, 2024
Merged

refactor: menu color tokens #13926

merged 2 commits into from
Sep 23, 2024

Conversation

wackerow
Copy link
Member

Description

Proposal: Migrate our "menu" tokens to tokens that are more generalizable.

Instead of declaring a whole array of specific "menu" tokens, with different level numbers, this PR suggests adding the additional shades of gray that are needed as additional background token shades.

We currently only have background and background-highlight for background tokens. This would add low, medium and high background variants to be used as layers to any stack (ie. nested menus, nested accordions, or any other nested elements).

These tokens were then used directly at the component level, updating and removing the existing usage of "menu-x-(active-)background" with the new corresponding background token.

Similar approach with text, but unsure of potential naming convention here. Went with a nested approach under "body" as "body-menu-DEFAULT/low/medium/high"

Shade update:
This also fixes the shade that was --menu-1-active-background: var(--gray-150); to now use --background-low: var(--gray-100); in light mode:

image

Related Issue

Design system; theming updates

uses a "default, low, medium, high" structure for menu backgrounds and text colors, representing different layers to stacking menu sections. Blends this with existing DS to introduce "low" "medium" and "high" background colors.
@wackerow wackerow added design system this label will be used in all issues related to design system needs design approval 🧑‍🎨 Approval from a designer is needed before merging labels Sep 21, 2024
Copy link

netlify bot commented Sep 21, 2024

Deploy Preview for ethereumorg ready!

Name Link
🔨 Latest commit d589a91
🔍 Latest deploy log https://app.netlify.com/sites/ethereumorg/deploys/66f1e38e32198c0008238121
😎 Deploy Preview https://deploy-preview-13926--ethereumorg.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
7 paths audited
Performance: 45 (🔴 down 1 from production)
Accessibility: 93 (no change from production)
Best Practices: 89 (🔴 down 9 from production)
SEO: 92 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@pettinarip pettinarip left a comment

Choose a reason for hiding this comment

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

@wackerow great job on this. Its much cleaner and easier to reuse these colors now.

Not blocker: I agree with the naming, my only concern is the misunderstanding of usage between the old and new backgrounds (ie background-highlight vs background-high). I was thinking of something more specific like background-shade-low to make them feel like lower level background colors and avoid potential overuse. Not strong opinion either so feel free to ignore xD

@@ -132,7 +123,11 @@

--background: var(--black);
--background-highlight: var(--gray-900);
--background-medium: var(--gray-950); /* TODO: VERIFY */

/* TODO: Add "low" "medium" and "high" to design system */
Copy link
Member

Choose a reason for hiding this comment

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

nitpick: would avoid adding todos that are outside of the scope of the codebase as they are hard to maintain and easy to forget.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes yes, sounds like we have consensus and approval on this proposal, so I'll go ahead and remove that and add notes in the DS

Copy link
Contributor

@minimalsm minimalsm left a comment

Choose a reason for hiding this comment

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

LGTM! Will leave it upto you whether to address @pettinarip's comments here or separately

@wackerow wackerow merged commit 0246a35 into dev Sep 23, 2024
3 checks passed
@wackerow wackerow deleted the refactor-menu-colors branch September 23, 2024 21:54
@wackerow
Copy link
Member Author

Pulled in; Removed TODO's and updated design system in Figma... Will chat about and address the naming adjustments separately.

This was referenced Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design system this label will be used in all issues related to design system needs design approval 🧑‍🎨 Approval from a designer is needed before merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants