diff --git a/docs/guide/CSS.md b/docs/guide/CSS.md index 80753ddbd..985c4b41f 100644 --- a/docs/guide/CSS.md +++ b/docs/guide/CSS.md @@ -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. diff --git a/src/textual/widget.py b/src/textual/widget.py index 53fe29983..5cb278389 100644 --- a/src/textual/widget.py +++ b/src/textual/widget.py @@ -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: