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

RFC: Wrap every exported component with its own theme provider #418

Open
fbarl opened this issue Nov 14, 2018 · 0 comments
Open

RFC: Wrap every exported component with its own theme provider #418

fbarl opened this issue Nov 14, 2018 · 0 comments
Labels
chore Related to fix/refinement/improvement of end user or new/existing developer functionality needs-discussion Issue is a question or a proposal that needs discussion style-guide Part of the effort towards a unified design system

Comments

@fbarl
Copy link
Contributor

fbarl commented Nov 14, 2018

Why?

So that the users of ui-components don't have to do it themselves by installing styled-components in their client app, importing our theme and passing it to the <ThemeProvider /> wrapper - those should be the internals that the user of our components shouldn't have to think about - besides, it arguably goes against atomic components principles.

How?

We could create a HOC wrapper withThemeProvider that we could use on all our components - it could take the optional theme as a component param that it would pass along to the component, which would enable our components to be used with different themes. If no theme prop is provided, we could default to the current theme.

Potential downsides

  • Performance?
  • More complex theming environment?
  • ¯\(ツ)

Motivated by #411.

cc @foot @guyfedwards

@fbarl fbarl added needs-discussion Issue is a question or a proposal that needs discussion chore Related to fix/refinement/improvement of end user or new/existing developer functionality style-guide Part of the effort towards a unified design system labels Nov 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Related to fix/refinement/improvement of end user or new/existing developer functionality needs-discussion Issue is a question or a proposal that needs discussion style-guide Part of the effort towards a unified design system
Projects
None yet
Development

No branches or pull requests

1 participant