Theme tweaks and fixes, swap primary and secondary of textual-dark

This commit is contained in:
Darren Burns
2024-10-23 16:05:35 +01:00
parent be4a816224
commit 076c1078a9
5 changed files with 16 additions and 13 deletions

View File

@@ -276,7 +276,7 @@ class ChangingThemeApp(App[None]):
yield MarkdownViewer(EXAMPLE_MARKDOWN)
with Horizontal(id="buttons"):
yield Button("Button 1")
yield Button("Button 1", variant="primary")
yield Button.success("Success 2")
yield Button.error("Error 3")
yield Button.warning("Warning 4")
@@ -299,6 +299,7 @@ class ChangingThemeApp(App[None]):
table = DataTable[Any]()
table.add_columns(*HEADERS)
table.add_rows(ROWS)
table.zebra_stripes = True
yield table
yield ListView(
ListItem(Label("One")),

View File

@@ -65,12 +65,13 @@ class Theme:
BUILTIN_THEMES: dict[str, Theme] = {
"textual-dark": Theme(
name="textual-dark",
primary="#004578",
secondary="#0178D4",
primary="#0178D4",
secondary="#004578",
accent="#ffa62b",
warning="#ffa62b",
error="#ba3c5b",
success="#4EBF71",
foreground="#e0e0e0",
dark=True,
),
"textual-light": Theme(

View File

@@ -68,21 +68,21 @@ class Button(Widget, can_focus=True):
}
&.-primary {
background: $secondary;
background: $primary;
color: $text;
border-top: tall $secondary-lighten-3;
border-bottom: tall $secondary-darken-3;
border-top: tall $primary-lighten-3;
border-bottom: tall $primary-darken-3;
&:hover {
background: $secondary-darken-2;
background: $primary-darken-2;
color: $text;
border-top: tall $secondary;
border-top: tall $primary;
}
&.-active {
background: $secondary;
border-bottom: tall $secondary-lighten-3;
border-top: tall $secondary-darken-3;
background: $primary;
border-bottom: tall $primary-lighten-3;
border-top: tall $primary-darken-3;
}
}

View File

@@ -336,7 +336,7 @@ class DataTable(ScrollView, Generic[CellType], can_focus=True):
&:dark {
background: $surface;
& > .datatable--even-row {
background: $secondary 15%;
background: $surface-lighten-1 50%;
}
}
@@ -356,7 +356,7 @@ class DataTable(ScrollView, Generic[CellType], can_focus=True):
}
& > .datatable--even-row {
background: $secondary 10%;
background: $surface-lighten-1 50%;
}
& > .datatable--cursor {

View File

@@ -677,6 +677,7 @@ class Markdown(Widget):
padding: 0 2 1 2;
layout: vertical;
color: $foreground;
background: $surface;
overflow-y: auto;
&:focus {