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

How to dynamically switch themes? #2550

Closed
gravese opened this issue Oct 16, 2024 · 1 comment
Closed

How to dynamically switch themes? #2550

gravese opened this issue Oct 16, 2024 · 1 comment

Comments

@gravese
Copy link

gravese commented Oct 16, 2024

Image
Image

I want to use this chart library externally, but when I tried to switch themes, I found that importing multiple theme CSS files would be overwritten。

@nickofthyme
Copy link
Collaborator

nickofthyme commented Oct 16, 2024

Yeah unfortunately this is not ideal as the chart theming depends on both the Theme as a javascript object and the exported scss files.

One way to do this is using a nested @import, as we do in our storybook for dynamically switching themes.

html {
font-size: 14px !important;
&.light-theme {
@import '~@elastic/eui/dist/eui_theme_light';
@import '~@elastic/charts/src/theme_only_light';

@gravese gravese closed this as completed Oct 17, 2024
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

2 participants