Simplifying CSS, fixing light mode toggle button more

This commit is contained in:
Darren Burns
2024-11-14 12:07:48 +00:00
parent a2407f9377
commit 1c909aaa93
3 changed files with 2 additions and 23 deletions

View File

@@ -364,8 +364,8 @@ class ChangingThemeApp(App[None]):
yield Header(show_clock=True, icon="🐟")
yield ThemeList(id="theme-list")
with VerticalScroll(id="widget-list", can_focus=False) as container:
yield Switch()
yield ToggleButton(label="Toggle Button")
yield SelectionList[int](
("Falken's Maze", 0, True),
("Black Jack", 1),
@@ -482,8 +482,6 @@ class ChangingThemeApp(App[None]):
"Virgon",
)
yield Switch()
yield Footer()
def on_mount(self) -> None:

View File

@@ -72,23 +72,6 @@ class Switch(Widget, can_focus=True):
border: tall $border;
background-tint: $foreground 5%;
}
&:light {
& > .switch--slider {
background: $surface-lighten-2;
color: $surface-darken-1;
}
&.-on {
& > .switch--slider {
color: $success-lighten-1;
}
&:hover > .switch--slider {
color: $success;
}
}
&:hover > .switch--slider {
color: $surface-darken-2;
}
}
}
"""

View File

@@ -78,13 +78,11 @@ class ToggleButton(Static, can_focus=True):
text-style: $block-cursor-text-style;
}
}
&:hover {
&:blur:hover {
& > .toggle--label {
background: $block-hover-background;
}
}
}
""" # TODO: https://github.com/Textualize/textual/issues/1780