Marimo Islands dark mode?
Having trouble getting marimo islands to work in dark mode. The src code in
useTheme.ts
suggests the way to achieve this is using a "dark-mode" class in the island body, or specifying data-theme=dark
in the island tag, but I haven't had any luck with either of those methods..
Any other alternatives? styling with global css seems futile too, since it's inside a shadow DOM8 Replies
I haven’t tried it in a while, but I think if you add a classname “dark” to the body, it may work
oh I see - it does affect markdown output, but not ui elements (perhaps cz they're inside a shadow DOM?)
minimal file to reproduce
hmm seems like a bug then, we should be resolving:
inspecting the elements, suggests that right before the
#shadow-root
the properties are set by the external stylesheet
but inside the #shadow-root
those get overwritten by a constructed stylesheet (presumably you're using something like CSSStyleSheet
to inherit styles into the shadow DOM?)
seems like that check isn't being resolved in the second constructed stylesheetOk thanks for looking into this. I can try to fix this this week
thanks!
for now, I'll probably style the UI elements directly in the notebook (using e.g.
mo.ui.slider().style()
)