[libadwaita/wip/exalm/oapcity] stylesheet: Use smaller opacity for disabled flat buttons




commit de3d8eccf7a38a5ae92b02572ebbac8cd40bd7c3
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Fri Oct 22 12:21:10 2021 +0500

    stylesheet: Use smaller opacity for disabled flat buttons
    
    They are hard to tell apart from regular atm. Since they have either icons
    with 2px strokes or bold text, and nothing else, they need to be more
    transparent than others.

 src/stylesheet/_colors.scss          | 2 ++
 src/stylesheet/widgets/_buttons.scss | 4 ++++
 2 files changed, 6 insertions(+)
---
diff --git a/src/stylesheet/_colors.scss b/src/stylesheet/_colors.scss
index 3cc7bfdd..686408cb 100644
--- a/src/stylesheet/_colors.scss
+++ b/src/stylesheet/_colors.scss
@@ -82,12 +82,14 @@ $focus_border_color:  gtkalpha($accent_bg_color, $focus_border_opacity);
 $dim_label_opacity: 0.55;
 $dimmer_opacity: 0.3;
 $disabled_opacity: 0.5;
+$strong_disabled_opacity: 0.3;
 
 // High Contrast color overrides
 @if $contrast == 'high' {
   $dim_label_opacity: 0.9;
   $dimmer_opacity: 0.8;
   $disabled_opacity: 0.7;
+  $strong_disabled_opacity: 0.5;
 
   $trough_color: gtkalpha(currentColor, .3);
   $trough_hover_color: gtkalpha(currentColor, .4);
diff --git a/src/stylesheet/widgets/_buttons.scss b/src/stylesheet/widgets/_buttons.scss
index 66e67f95..06cebdae 100644
--- a/src/stylesheet/widgets/_buttons.scss
+++ b/src/stylesheet/widgets/_buttons.scss
@@ -233,6 +233,10 @@ button {
       }
     }
 
+    &:disabled:not(:checked) {
+      filter: opacity($strong_disabled_opacity);
+    }
+
     &.suggested-action {
       color: $accent_color;
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]