Skip to content
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

Fix "theme" taxonomy #313

Closed
mattkrick opened this issue Oct 2, 2016 · 0 comments
Closed

Fix "theme" taxonomy #313

mattkrick opened this issue Oct 2, 2016 · 0 comments
Assignees

Comments

@mattkrick
Copy link
Member

Surfin through the stuff I noticed theme can mean different things in different places & I wanted to get to a place where we can all agree on the same words.

So, I propose:

  • appTheme: The thing that comes from theme.json (We should probably rename that to match). contains brand, palette, typography. The object is completely static. Servers as a defaultTheme when the desired value does not exist in customTheme below.
  • colorPalette: a string like 'cool', 'warm', 'dark' that is passed into a generic component like Button or IconLink. Runtime.
  • customTheme: The team-specific colors passed in via context. Currently not implemented. At runtime, the customTheme is deeply merged with the defaultTheme & the output is supplied to a styleThunk (the thing that creates the styles object at the bottom of a component).

With these 3 things, we'll be pretty unstoppable. I imagine something like this:

const styleThunk = (customTheme) => ({
  root: {
    color: customTheme.primary // defaults to appTheme.palette.primary
  }
})
export default withStyles(styleThunk)(Button)
@mattkrick mattkrick self-assigned this Oct 2, 2016
@mattkrick mattkrick mentioned this issue Oct 3, 2016
@jordanh jordanh closed this as completed in 681a5dd Oct 4, 2016
@ghost ghost assigned jordanh Oct 4, 2016
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

No branches or pull requests

2 participants