Theming responsibility should be delegated to the consuming project for 3 reasons:
1)
Currently we get around Emotion lib integration issues by creating our own context in uikit and exporting useTheme with our own ThemeProvider
This works because context is shared.
css={(theme) => {...}} this should work but Emotion uses it's own jsx runtime which in turn uses its own theme context, so our theme will always be empty object
suggestion is to move theming out of UIKit and have the consuming project decide the process
we can still export a default theme that is compatible with an Emotion theme provider
2)
Types are too tightly coupled to the defaultTheme. Extending the theme in a project will cause type errors.
3)
no reason for reactivity of theme provider. can just use normal object
if a project wants reactivity eg. for a dark mode it can be added to its project
Theming responsibility should be delegated to the consuming project for 3 reasons:
1)
Currently we get around Emotion lib integration issues by creating our own context in uikit and exporting
useTheme
with our ownThemeProvider
This works because context is shared.
css={(theme) => {...}}
this should work but Emotion uses it's own jsx runtime which in turn uses its own theme context, so our theme will always be empty objectsuggestion is to move theming out of UIKit and have the consuming project decide the process we can still export a default theme that is compatible with an Emotion theme provider
2)
Types are too tightly coupled to the defaultTheme. Extending the theme in a project will cause type errors.
3)
no reason for reactivity of theme provider. can just use normal object if a project wants reactivity eg. for a
dark mode
it can be added to its project