Skip to content

Instantly share code, notes, and snippets.

@maecapozzi
Created August 30, 2021 00:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maecapozzi/31fd3a036449a9bd6d178e9df7f8f380 to your computer and use it in GitHub Desktop.
Save maecapozzi/31fd3a036449a9bd6d178e9df7f8f380 to your computer and use it in GitHub Desktop.
design tokens - second layer of abstraction
import colors from './colors.ts';
const baseTheme = {
colors: {
// primary is a semantic name.
primary: colors.blue100,
secondary: colors.gray:100,
}
}
const brandATheme = {
...baseTheme
}
// A brand theme can extend other themes
// and then override some aspects when needed
const brandBTheme = {
...baseTheme,
colors: {
primary: colors.blue200,
secondary: colors.gray:200,
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment