RFC: Wrap every exported component with its own theme provider #418
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
Why?
So that the users of
ui-components
don't have to do it themselves by installingstyled-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 optionaltheme
as a component param that it would pass along to the component, which would enable our components to be used with different themes. If notheme
prop is provided, we could default to the current theme.Potential downsides
Motivated by #411.
cc @foot @guyfedwards
The text was updated successfully, but these errors were encountered: