mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Theme tweaks and fixes, swap primary and secondary of textual-dark
This commit is contained in:
@@ -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")),
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -677,6 +677,7 @@ class Markdown(Widget):
|
||||
padding: 0 2 1 2;
|
||||
layout: vertical;
|
||||
color: $foreground;
|
||||
background: $surface;
|
||||
overflow-y: auto;
|
||||
|
||||
&:focus {
|
||||
|
||||
Reference in New Issue
Block a user