From aecac08b326130d890a7c5a1fa1a06a7752c4c50 Mon Sep 17 00:00:00 2001 From: Pavel Dedik Date: Sun, 9 Jun 2024 10:51:30 +0200 Subject: [PATCH] feat: Styling for disabled buttons --- ludic/catalog/buttons.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/ludic/catalog/buttons.py b/ludic/catalog/buttons.py index 1f9a2a5..64ca1f9 100644 --- a/ludic/catalog/buttons.py +++ b/ludic/catalog/buttons.py @@ -24,14 +24,19 @@ class Button(ComponentStrict[PrimitiveChildren, ButtonAttrs]): "padding": f"{theme.sizes.xxxxs * 0.8} {theme.sizes.xs}", "border": "none", "border-radius": theme.rounding.normal, - "cursor": "pointer", "font-size": theme.fonts.size, "transition": "0.1s filter linear, 0.1s -webkit-filter linear", }, + ".btn:enabled": { + "cursor": "pointer", + }, + ".btn:disabled": { + "filter": "opacity(50%)", + }, ":not(a).btn": { "background-color": theme.colors.light.darken(2), }, - (".btn:hover", ".btn:focus"): { + (".btn:hover:enabled", ".btn:focus:enabled"): { "filter": "brightness(85%)", "text-decoration": "none", }, @@ -111,7 +116,7 @@ class ButtonSuccess(Button): ".btn.success": { "color": theme.colors.success.readable(), "background-color": theme.colors.success, - } + }, } ) @@ -128,7 +133,7 @@ class ButtonDanger(Button): ".btn.danger": { "color": theme.colors.danger.readable(), "background-color": theme.colors.danger, - } + }, } )