Skip to content

Commit 83707ad

Browse files
committed
Use nested CSS in Tabs
1 parent 79e42fa commit 83707ad

File tree

1 file changed

+20
-17
lines changed

1 file changed

+20
-17
lines changed

src/textual/widgets/_tabs.py

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -95,23 +95,26 @@ class Tab(Static):
9595
padding: 1 1 0 2;
9696
text-align: center;
9797
color: $text-disabled;
98-
}
99-
Tab.-active {
100-
text-style: bold;
101-
color: $text;
102-
}
103-
Tab:hover {
104-
text-style: bold;
105-
}
106-
Tab.-active:hover {
107-
color: $text;
108-
}
109-
Tab:disabled {
110-
color: $text-disabled;
111-
text-opacity: 50%;
112-
}
113-
Tab.-hidden {
114-
display: none;
98+
99+
&:hover {
100+
text-style: bold;
101+
}
102+
&:disabled {
103+
color: $text-disabled;
104+
text-opacity: 50%;
105+
}
106+
107+
&.-active {
108+
color: $text;
109+
text-style: bold;
110+
111+
&:hover {
112+
color: $text;
113+
}
114+
}
115+
&.-hidden {
116+
display: none;
117+
}
115118
}
116119
"""
117120

0 commit comments

Comments
 (0)