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

Improve DarkTheme #61

Open
paveldedik opened this issue Jun 3, 2024 · 3 comments
Open

Improve DarkTheme #61

paveldedik opened this issue Jun 3, 2024 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@paveldedik
Copy link
Member

Motivation

The dark theme is not used anywhere and what it looks like is not validated. It would be nice to make it look good and validate readability on all devices.

Hints

Allow switching the theme in https://github.com/paveldedik/ludic-web and improve styling according to that.

@paveldedik paveldedik added the enhancement New feature or request label Jun 3, 2024
@paveldedik paveldedik added this to the 0.5 milestone Jun 3, 2024
@robwalton
Copy link

robwalton commented Jun 23, 2024

The background colour stays white when using the dark theme for me.

I switch to the dark mode as describe in the doc:

dark = themes.DarkTheme()
themes.set_default_theme(dark)

style.load(theme=dark). # <-- may not be needed


@asynccontextmanager
async def lifespan(_: LudicApp) -> AsyncIterator[None]:
    style.load(cache=True)
    yield


app = LudicApp(
    debug=True,
    lifespan=lifespan,
    routes=[Mount("/static", StaticFiles(directory="static"), name="static")],
)

And then followed the instructions here: https://getludic.dev/catalog/#htmlpage-component . However the background is still white. Am I doing it right please?

(I'm really enjoying ludic. Thanks for making it!)

@paveldedik
Copy link
Member Author

Thank you for reporting the issue.

You are doing it right. There was a missing CSS for the dark theme to change background. Sorry. I just released new version fixing that.

And you are right, the third line with style.load(theme=dark) is not needed, the first two lines already take care of the theme switching.

I'm glad you are enjoying Ludic :-)

@robwalton
Copy link

The new version looks great now, thanks.

@paveldedik paveldedik added the good first issue Good for newcomers label Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants