mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Add enabled and disabled pseudo-classes
Note that this doesn't touch the application of stylesheets yet, in terms of things like specificity; this just makes sure that the classes exist and can be seen.
This commit is contained in:
@@ -315,6 +315,8 @@ The `background: green` is only applied to the Button underneath the mouse curso
|
||||
|
||||
Here are some other pseudo classes:
|
||||
|
||||
- `:disabled` Matches widgets which are in a disabled state.
|
||||
- `:enabled` Matches widgets which are in an enabled state.
|
||||
- `:focus` Matches widgets which have input focus.
|
||||
- `:focus-within` Matches widgets with a focused a child widget.
|
||||
|
||||
|
||||
@@ -2084,6 +2084,7 @@ class Widget(DOMNode):
|
||||
Names of the pseudo classes.
|
||||
|
||||
"""
|
||||
yield "disabled" if self.disabled else "enabled"
|
||||
if self.mouse_over:
|
||||
yield "hover"
|
||||
if self.has_focus:
|
||||
|
||||
Reference in New Issue
Block a user