marimo icon indicating copy to clipboard operation
marimo copied to clipboard

marimo.app_meta.theme

Open metaboulie opened this issue 1 year ago • 3 comments

Description

Add a marimo.settings, to control or only read the settings if controlling setting in cell will interrupt the notebook.

Suggested solution

Why this feature can be useful: We can use the value of marimo.settings.width, marimo.setting.theme, etc to render some ui. for instance, plotly, when specifying a figure's layout, we can do the following:

template = 'plotly_dark` if marimo.settings.theme == 'dark' else 'plotly_white'
fig.update_layout(
    template=template
)

then we can get a dark plotly figure in dark mode and a light one in light mode

Alternative

No response

Additional context

No response

metaboulie avatar Jun 15 '24 12:06 metaboulie

We should expose the theme for sure - not sure if we need all the other settings.

We can put this in AppMetadata.

mscolnick avatar Jun 15 '24 13:06 mscolnick

Also - it would be nice if marimo could handle these setting under the hood (but can be turned off).

e.g. marimo.theme.autohandle_third_party()

mscolnick avatar Jun 15 '24 13:06 mscolnick

@metaboulie - i updated the title to add marimo.app_meta.theme. We can think about adding more settings there over time for specific use-cases

For the implementor: We have something already called AppMetadata. That is currently an internal class that we probably don't want to expose everything in there. So we can rename that, or come up with another name for what marimo.app_meta is

mscolnick avatar Jun 17 '24 00:06 mscolnick

Closed by @metaboulie via #2126

mscolnick avatar Aug 29 '24 13:08 mscolnick