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

marimo.app_meta.theme #1624

Closed
metaboulie opened this issue Jun 15, 2024 · 4 comments
Closed

marimo.app_meta.theme #1624

metaboulie opened this issue Jun 15, 2024 · 4 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@metaboulie
Copy link
Contributor

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

@mscolnick
Copy link
Contributor

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

We can put this in AppMetadata.

@mscolnick
Copy link
Contributor

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 mscolnick added the good first issue Good for newcomers label Jun 17, 2024
@mscolnick mscolnick changed the title marimo.settings marimo.meta.theme Jun 17, 2024
@mscolnick
Copy link
Contributor

mscolnick commented Jun 17, 2024

@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 mscolnick changed the title marimo.meta.theme marimo.app_meta.theme Jun 17, 2024
@mscolnick
Copy link
Contributor

Closed by @metaboulie via #2126

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants