You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider a case where css rules apply styling to a page's body HTML element:
importsolaraasslfromsolaraimportlabassl_lab@sl.componentdefPage():
sl.Style(
""" body { max-width: 800px; margin: 30px auto 2em auto !important; padding-left: 2em; padding-right: 2em; } """
)
sl_lab.ThemeToggle()
sl.Markdown("# Hello, Solara!")
In this case, when the app is in dark mode, the background is white (potentially relating to #532):
Ideally, one could also add to the body background-color: var(--theme-background) or something similar to prevent this issue. However, since the active theme doesn't save it's foreground/background colors to css variables, this proves difficult in practice.
What is the recommended best approach?
The text was updated successfully, but these errors were encountered:
Is this specific to body? Because we do not have a good way to style that yet based on the dark/light theme. If so, we should see if we can find a way (e.g. adding a data-theme=dark data attribute, or add theme--light/dark to the body CSS classes).
If it's only for child components, you can use this solution
which is, adding a class 'my-own-background', and the css:
Consider a case where css rules apply styling to a page's
body
HTML element:In this case, when the app is in dark mode, the background is white (potentially relating to #532):
Ideally, one could also add to the body
background-color: var(--theme-background)
or something similar to prevent this issue. However, since the active theme doesn't save it's foreground/background colors to css variables, this proves difficult in practice.What is the recommended best approach?
The text was updated successfully, but these errors were encountered: