Skip to content

Theme can't be changed for ipywidgets and solara.Markdown widget #635

@egormkn

Description

@egormkn

Hello!

Changing theme with ThemeToggle does not apply to ipywidgets and solara.Markdown widget. They always use the theme that was applied during the initial page load. Here is an example page:

import textwrap

import reacton.ipywidgets as rw
import solara


@solara.component
def Layout(children):
    dark_effective = solara.lab.use_dark_effective()
    return solara.AppLayout(children=children, toolbar_dark=dark_effective, color=None)


@solara.component
def Page():
    with solara.AppBar():
        solara.lab.ThemeToggle()

    rw.Button(description="Some button")

    rw.IntText(value=7, description="Some int:", disabled=False)

    rw.HTMLMath(value=r"$\text{Some equation:}\ \int f(x) dx$")

    solara.Markdown(
        textwrap.dedent(
            r"""
            # This is a title

            ## This is a subtitle
            This is a markdown text, **bold** and *italic* text is supported.

            ## Math
            Also, $x^2$ is rendered as math.

            Or multiline math:
            $$
            \int_0^1 x^2 dx = \frac{1}{3}
            $$

            """
        )
    )

markdown

UPD: I tried to create an example on app.py.cafe, but ipywidget styles seems to be broken there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions