mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Input cursor styling
This commit is contained in:
@@ -307,6 +307,7 @@ class ChangingThemeApp(App[None]):
|
||||
yield Footer()
|
||||
|
||||
def on_mount(self) -> None:
|
||||
self.theme = "nord"
|
||||
text_area = self.query_one(TextArea)
|
||||
text_area.selection = Selection((0, 0), (1, 10))
|
||||
|
||||
|
||||
@@ -101,6 +101,8 @@ BUILTIN_THEMES: dict[str, Theme] = {
|
||||
"block-cursor-foreground": "#2E3440",
|
||||
"block-cursor-text-style": "none",
|
||||
"footer-key-foreground": "#88C0D0",
|
||||
"input-cursor-foreground": "#2E3440",
|
||||
"input-cursor-background": "#88C0D0",
|
||||
},
|
||||
),
|
||||
"gruvbox": Theme(
|
||||
|
||||
@@ -158,9 +158,8 @@ class Input(Widget, can_focus=True):
|
||||
background-tint: $foreground 5%;
|
||||
}
|
||||
&>.input--cursor {
|
||||
background: $surface;
|
||||
color: $foreground;
|
||||
text-style: reverse;
|
||||
background: $input-cursor-background;
|
||||
color: $input-cursor-foreground;
|
||||
}
|
||||
&>.input--placeholder, &>.input--suggestion {
|
||||
color: $text-disabled;
|
||||
|
||||
@@ -66,7 +66,7 @@ class RadioSet(VerticalScroll, can_focus=True, can_focus_children=False):
|
||||
background-tint: $foreground 5%;
|
||||
|
||||
& > RadioButton.-selected {
|
||||
color: $text;
|
||||
color: $block-cursor-foreground;
|
||||
text-style: $block-cursor-text-style;
|
||||
background: $block-cursor-background;
|
||||
& > .toggle--button {
|
||||
|
||||
@@ -118,13 +118,13 @@ TextArea {
|
||||
}
|
||||
|
||||
&:focus {
|
||||
border: tall $secondary;
|
||||
border: tall $border;
|
||||
}
|
||||
|
||||
&:dark {
|
||||
.text-area--cursor {
|
||||
color: $text 90%;
|
||||
background: $foreground 90%;
|
||||
color: $input-cursor-foreground;
|
||||
background: $input-cursor-background;
|
||||
}
|
||||
&.-read-only .text-area--cursor {
|
||||
background: $warning-darken-1;
|
||||
|
||||
@@ -67,7 +67,7 @@ class ToggleButton(Static, can_focus=True):
|
||||
border: tall $border;
|
||||
background-tint: $foreground 5%;
|
||||
& > .toggle--label {
|
||||
color: $text;
|
||||
color: $block-cursor-foreground;
|
||||
background: $block-cursor-background;
|
||||
text-style: $block-cursor-text-style;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user