mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Fixing colors in select widget
This commit is contained in:
@@ -207,6 +207,14 @@ class ColorSystem:
|
||||
colors["text-muted"] = "ansi_default"
|
||||
colors["text-disabled"] = "ansi_default"
|
||||
|
||||
# Foreground colors
|
||||
colors["foreground-muted"] = get(
|
||||
"foreground-muted", foreground.with_alpha(0.6).hex
|
||||
)
|
||||
colors["foreground-disabled"] = get(
|
||||
"foreground-disabled", foreground.with_alpha(0.38).hex
|
||||
)
|
||||
|
||||
# The cursor color for widgets such as OptionList, DataTable, etc.
|
||||
colors["block-cursor-foreground"] = get(
|
||||
"block-cursor-foreground", colors["text"]
|
||||
|
||||
@@ -49,7 +49,7 @@ class SelectOverlay(OptionList):
|
||||
SelectOverlay {
|
||||
border: tall $border-blurred;
|
||||
background: $surface;
|
||||
color: $text;
|
||||
color: $foreground;
|
||||
width: 100%;
|
||||
padding: 0 1;
|
||||
}
|
||||
@@ -110,7 +110,7 @@ class SelectCurrent(Horizontal):
|
||||
|
||||
DEFAULT_CSS = """
|
||||
SelectCurrent {
|
||||
color: $text;
|
||||
color: $foreground;
|
||||
width: 1fr;
|
||||
height: auto;
|
||||
padding: 0 2;
|
||||
@@ -123,12 +123,12 @@ class SelectCurrent(Horizontal):
|
||||
Static#label {
|
||||
width: 1fr;
|
||||
height: auto;
|
||||
color: $text-disabled;
|
||||
color: $foreground 50%;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
&.-has-value Static#label {
|
||||
color: $text;
|
||||
color: $foreground;
|
||||
}
|
||||
|
||||
.arrow {
|
||||
@@ -136,7 +136,7 @@ class SelectCurrent(Horizontal):
|
||||
width: 1;
|
||||
height: 1;
|
||||
padding: 0 0 0 1;
|
||||
color: $text-muted;
|
||||
color: $foreground 50%;
|
||||
background: transparent;
|
||||
}
|
||||
}
|
||||
@@ -214,6 +214,7 @@ class Select(Generic[SelectType], Vertical, can_focus=True):
|
||||
DEFAULT_CSS = """
|
||||
Select {
|
||||
height: auto;
|
||||
color: $foreground;
|
||||
background: $surface;
|
||||
border: tall $border-blurred;
|
||||
|
||||
@@ -233,6 +234,7 @@ class Select(Generic[SelectType], Vertical, can_focus=True):
|
||||
max-height: 12;
|
||||
overlay: screen;
|
||||
constrain: none inside;
|
||||
color: $foreground;
|
||||
|
||||
&:focus {
|
||||
border: tall $border;
|
||||
|
||||
Reference in New Issue
Block a user