Replies: 1 comment 3 replies
-
Yea the key piece is that the class needs to live on the host element outside of the shadow DOM. In your render function you would have to do something like: render () {
this.classList.add("sl-theme-dark")
return html``
} |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to follow the multiple theme setup described here: https://shoelace.style/getting-started/themes#using-multiple-themes
I'm using LitElement 3.x
So I have the class
sl-theme-light
set on myhtml
tag. I'm including both the light and dark theme css in my html head.Then I have a certain component called
top-bar
. Inside I set the class tosl-theme-dark
. Then use the variable--sl-color-gray-200
for the background.The background color is however a light gray, instead of the dark gray that I expect. Changing the html class to
sl-theme-dark
does make the background color dark, it's just the multiple themes activation part that I don't understand.Am I missing a step or misunderstanding this setup?
Beta Was this translation helpful? Give feedback.
All reactions