Skip to content

[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

Merged
merged 4 commits into from
Oct 13, 2022

Conversation

Effanuel
Copy link
Contributor

Description

Changelog

  • Added generateTokens method for generating design tokens based on chosen color.

return mode === 'light' ? this.generateLightModeTokens(color) : this.generateDarkModeTokens(color);
}

private generateLightModeTokens(color: string) {
Copy link
Contributor Author

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

Copy link
Contributor

@lidord-wix lidord-wix left a 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).

@lidord-wix
Copy link
Contributor

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 :)

Copy link
Contributor

@lidord-wix lidord-wix left a 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 :)

Comment on lines 51 to 56
Scheme.loadSchemes({
light: this.generateLightModeTokens(color),
dark: this.generateDarkModeTokens(color)
});
Object.assign(this, Scheme.getScheme());
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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)
});
}

@lidord-wix lidord-wix merged commit bb3a658 into master Oct 13, 2022
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