From 0d35a291bee8b3257fab576f3ef094b0a8d128c3 Mon Sep 17 00:00:00 2001 From: Pavel Dedik Date: Mon, 24 Jun 2024 19:31:56 +0200 Subject: [PATCH] fix(themes): Improve dark theme --- examples/__init__.py | 8 ++++---- examples/edit_row.py | 2 +- ludic/catalog/pages.py | 3 +++ ludic/styles/themes.py | 8 ++++---- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/examples/__init__.py b/examples/__init__.py index 9888dbe..6f27bdb 100644 --- a/examples/__init__.py +++ b/examples/__init__.py @@ -5,10 +5,10 @@ from ludic.catalog.layouts import Center, Stack from ludic.catalog.pages import Body, Head, HtmlPage from ludic.html import meta -from ludic.types import ( - AnyChildren, - Component, -) +from ludic.styles import set_default_theme, themes, types +from ludic.types import AnyChildren, Component + +set_default_theme(themes.LightTheme(measure=types.Size(90, "ch"))) @dataclass diff --git a/examples/edit_row.py b/examples/edit_row.py index 0852b08..1431376 100644 --- a/examples/edit_row.py +++ b/examples/edit_row.py @@ -123,7 +123,7 @@ def render(self) -> TableRow: hx_include="closest tr", classes=["small"], ), - classes=["cluster-small"], + classes=["cluster-small", "centered"], ), classes=["editing"], ) diff --git a/ludic/catalog/pages.py b/ludic/catalog/pages.py index 8698adb..eb3d06f 100644 --- a/ludic/catalog/pages.py +++ b/ludic/catalog/pages.py @@ -64,6 +64,9 @@ class HtmlPage(ComponentStrict[Head, Body, NoAttrs]): "padding": "0", "line-height": theme.line_height, }, + "body": { + "background-color": theme.colors.white, + }, ("html", "body", "div", "header", "nav", "main", "footer"): { "max-inline-size": "none", }, diff --git a/ludic/styles/themes.py b/ludic/styles/themes.py index d038990..75e5d41 100644 --- a/ludic/styles/themes.py +++ b/ludic/styles/themes.py @@ -227,15 +227,15 @@ class DarkTheme(Theme): colors: Colors = field( default_factory=lambda: Colors( primary=Color("#0d6efd"), - secondary=Color("#6c757d"), + secondary=Color("#898989"), success=Color("#198754"), info=Color("#0dcaf0"), warning=Color("#ffc107"), danger=Color("#dc3545"), light=Color("#414549"), - dark=Color("#f8f8f8"), - white=Color("#000"), - black=Color("#fff"), + dark=Color("#d8d8d8"), + white=Color("#131313"), + black=Color("#e5e5e5"), ) )