mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Simplifying CSS, fixing light mode toggle button more
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
"""
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user