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

Replace custom theming with built in Emotion theming #2

Closed
WVAviator opened this issue Apr 29, 2022 · 1 comment · Fixed by #3
Closed

Replace custom theming with built in Emotion theming #2

WVAviator opened this issue Apr 29, 2022 · 1 comment · Fixed by #3

Comments

@WVAviator
Copy link
Owner

https://emotion.sh/docs/typescript#define-a-theme

Define the theme type and use Emotion's Theme provider and useTheme hook.

What about a default theme?

@WVAviator
Copy link
Owner Author

Based on this thread: emotion-js/emotion#811
The best way to introduce a default theme if the user does not include a ThemeProvider is to import the default theme and use it if there is no ThemeContext provided. Not sure I like this - but maybe I can include it in a custom useTheme hook. I could also consider using styled components so as to receive the default theme as a prop with a default argument.

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

Successfully merging a pull request may close this issue.

1 participant