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

Theming #124

Open
ciaranschutte opened this issue Jun 5, 2023 · 1 comment
Open

Theming #124

ciaranschutte opened this issue Jun 5, 2023 · 1 comment

Comments

@ciaranschutte
Copy link
Contributor

ciaranschutte commented Jun 5, 2023

Theming responsibility should be delegated to the consuming project for 3 reasons:

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

Types are too tightly coupled to the defaultTheme. Extending the theme in a project will cause type errors.

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

@ciaranschutte
Copy link
Contributor Author

@emotion/react/src/emotion-element => theme
used by @emotion/react/jsx-runtime

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

1 participant