-
Notifications
You must be signed in to change notification settings - Fork 734
[Guild Week] Added generator for basic design tokens #2265
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
Conversation
return mode === 'light' ? this.generateLightModeTokens(color) : this.generateDarkModeTokens(color); | ||
} | ||
|
||
private generateLightModeTokens(color: string) { |
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.
generateLightModeTokens
and generateDarkModeTokens
methods are very similar, but I would rather have them separate, then to couple them
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.
Looks very good! thank you for taking this task :)
Consider adding another method to apply the new design tokens automatically (we can assume that most of the users that will use the generateTokens()
method will load them right after using the loadSchemes()
method, so we can offer a method that gets color and load the relevant light and dark design tokens).
@Effanuel I think you missed this comment :) |
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.
Looks great!
see my last comment :)
src/style/colors.ts
Outdated
Scheme.loadSchemes({ | ||
light: this.generateLightModeTokens(color), | ||
dark: this.generateDarkModeTokens(color) | ||
}); | ||
Object.assign(this, Scheme.getScheme()); | ||
} |
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.
Scheme.loadSchemes({ | |
light: this.generateLightModeTokens(color), | |
dark: this.generateDarkModeTokens(color) | |
}); | |
Object.assign(this, Scheme.getScheme()); | |
} | |
this.loadSchemes({ | |
light: this.generateLightModeTokens(color), | |
dark: this.generateDarkModeTokens(color) | |
}); | |
} |
Description
Colors
class, since that method depends mostly on otherColors
class method.Changelog
generateTokens
method for generating design tokens based on chosen color.