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

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

Closed
egormkn opened this issue May 8, 2024 · 1 comment · Fixed by #636
Closed

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

egormkn opened this issue May 8, 2024 · 1 comment · Fixed by #636

Comments

@egormkn
Copy link

egormkn commented May 8, 2024

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.

@iisakkirotko
Copy link
Collaborator

Hey @egormkn!

Thanks a lot for reporting this. I think it's interesting that on solara.dev it seems like solara.Markdown body text does change theme, while titles, etc. don't. Either way, I believe I found the issue and will open a PR to fix it.

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

Successfully merging a pull request may close this issue.

2 participants