This repository was archived by the owner on Nov 26, 2024. It is now read-only.
generated from MetaMask/metamask-module-template
-
Notifications
You must be signed in to change notification settings - Fork 15
Refactoring the brand color object #585
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a24ece1 to
5cc9329
Compare
Collaborator
| lightTheme, | ||
| darkTheme, | ||
| Theme, | ||
| brandColor, |
Collaborator
Author
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Including brandColor export from root index. Changed formatting with extra export
| @@ -0,0 +1,130 @@ | |||
| export interface BrandColor { | |||
| /** white/white000: #ffffff */ | |||
Collaborator
Author
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These comments align with the Figma naming that engineers see in Figma and on hover of the object will also see the hex value
figma.mov
brianacnguyen
approved these changes
Jan 24, 2024
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces an enhancement to the
brandColorsobject that was recently added to our codebase. Although the initial implementation was not released, we identified a few areas for improvement to make the object more intuitive and compatible with developer tools.The original syntax,
brandColors.white['000'], had a couple of limitations. It didn't work optimally with intellisense, and the usage wasn't as straightforward as we desired.After further discussions and considerations, we decided to make two key changes:
Rename
brandColorstobrandColor: This change aligns with our convention of using singular names for types. It also makes the object name more intuitive when accessing individual colors.Adjust the object structure: Instead of accessing colors with
brandColor.white['000'], we've flattened the structure to allow for more straightforward access, likebrandColor.white000.These changes offer several benefits:
Related: #581
Before
Video shows 2 preivous options that we were exploring. The first displays it not working well with intellisense
autocomplete.mov
After
Below screencast shows new JS token story
after.tokens.mov
Below screencast shows iframe of JS token story in comparison to the Figma json story
after720.mov