marimo-team / marimo

A reactive notebook for Python — run reproducible experiments, execute as a script, deploy as an app, and version with git.
https://marimo.io
Apache License 2.0
6.14k stars 200 forks source link

Font enlargement #2125

Open TimWalter opened 2 weeks ago

TimWalter commented 2 weeks ago

Description

Hey, I am enjoying the possibility to use marimo notebooks to combine code to have live presentations using the slide or grid mode. However, one really problematic thing in my opinion is that even on the largest font e.g. markdown # or html h1 the font remains too small for presentations.

e.g. image

This is just too small for a full screen presentation.

Suggested solution

Since there is plenty of room at the bottom either increase the font size by default, such that smaller markdown headings etc. become more useful or add a parameter to edit.

Alternative

Using mermaid one can specify a Font size and cheat the system a bit e.g. test = ''' %%{init: {'themeVariables': { 'fontSize': '50px'}}}%% graph TD A["Demo"] ''' mo.mermaid(test)

But that is not a proper replacement.

Additional context

No response

TimWalter commented 2 weeks ago

Would you like my credit card number and password along with it?

[I think you have scammers around:/]

metaboulie commented 2 weeks ago

@TimWalter Hey, maybe you can try this

mo.md("""<h1 style="font-size: 120px;">Continuous Meeting Presentation</h1>""")

and alter the value of the font-size

You can also make a slider

slider = mo.ui.slider(
    30, 120, 5, label="Control the font size", show_value=True, value=50
)

and control the font size with this slider

mo.md(
    f"""
    <h1 style="font-size: {slider.value}px;">Continuous Meeting Presentation</h1>
    {slider}
    """
)
akshayka commented 2 weeks ago

Would you like my credit card number and password along with it?

[I think you have scammers around:/]

:( Sorry about that. I saw a scammer/bot yesterday.

mscolnick commented 2 weeks ago

@TimWalter - we've added support for custom theming (https://github.com/marimo-team/marimo/pull/2120) (https://docs.marimo.io/guides/theming.html). With this you can change the h1/h2 tags if you'd like.

If you want to change all markdown elements in lockstep - i am thinking of adding an app-config options for text_size. This would be t-shirt sizes instead of actual numbers since we want to increase headings and text with different resulting values.

Config paragraph font size
sm 0.875rem (14px)
base (default) 1rem (16px)
lg 1.125rem (18px)
xl 1.25rem (20px)
2xl 1.5rem (24px)

Let me know if that is preferable

TimWalter commented 1 week ago

Hey sounds cool! Of course adding custom CSS support could be very powerful for all things HTML but for markdown (which is just quicker to edit and has different use-cases IMO) I like your proposed idea

alefminus commented 1 week ago

I've just given a presentation on marimo with marimo and ran into the same problem, my workaround was to use the browser zoom feature. It was passable according to the feedback I got. I do think a built in solution would be better - with 200% the 6-dot icon per cell is not visible, and in general it is of course not an optimal presentation of marimo.