-
Notifications
You must be signed in to change notification settings - Fork 15
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
Refactoring the brand color object #585
Conversation
a24ece1
to
5cc9329
Compare
lightTheme, | ||
darkTheme, | ||
Theme, | ||
brandColor, |
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 */ |
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
Description
This PR introduces an enhancement to the
brandColors
object 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
brandColors
tobrandColor
: 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