[libadwaita/wip/exalm/stylesheet-cleanups: 12/13] stylesheet: Extract fill colors




commit 20985d2287391d7b06422168cf6205b1d601d6c4
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Fri May 21 15:00:56 2021 +0500

    stylesheet: Extract fill colors
    
    Similarly to trough colors, let's not copy-paste these around.

 src/stylesheet/_colors.scss            |  4 ++++
 src/stylesheet/widgets/_checks.scss    | 10 ++++------
 src/stylesheet/widgets/_level-bar.scss |  2 +-
 src/stylesheet/widgets/_scale.scss     |  4 ++--
 src/stylesheet/widgets/_switch.scss    |  8 ++++----
 5 files changed, 15 insertions(+), 13 deletions(-)
---
diff --git a/src/stylesheet/_colors.scss b/src/stylesheet/_colors.scss
index f984de30..9651495f 100644
--- a/src/stylesheet/_colors.scss
+++ b/src/stylesheet/_colors.scss
@@ -24,6 +24,10 @@ $view_active_color: transparentize(black, .85);
 $trough_color: transparentize($text_color, .85);
 $trough_hover_color: transparentize($text_color, .8);
 $trough_active_color: transparentize(black, .75);
+$fill_color: $selected_bg_color;
+$fill_text_color: $selected_fg_color;
+$fill_hover_color: mix($selected_bg_color, $text_color, 90%);
+$fill_active_color: mix($selected_bg_color, black, 80%);
 
 $scrollbar_bg_color: if($variant == 'light', mix($bg_color, $fg_color, 80%), mix($base_color, $bg_color, 
50%));
 $scrollbar_slider_color: mix($fg_color, $bg_color, 60%);
diff --git a/src/stylesheet/widgets/_checks.scss b/src/stylesheet/widgets/_checks.scss
index 3375348e..2139c345 100644
--- a/src/stylesheet/widgets/_checks.scss
+++ b/src/stylesheet/widgets/_checks.scss
@@ -31,19 +31,17 @@ radio {
 
   &:checked,
   &:indeterminate {
-    background-color: $selected_bg_color;
-    color: $selected_fg_color;
+    background-color: $fill_color;
+    color: $fill_text_color;
 
     @if $contrast == "high" {
       box-shadow: none;
     }
 
     &:hover {
-      background-color: mix($selected_bg_color, $text_color, 90%);
+      background-color: $fill_hover_color;
 
-      &:active {
-        background-color: mix($selected_bg_color, black, 80%);
-      }
+      &:active { background-color: $fill_active_color; }
     }
   }
 
diff --git a/src/stylesheet/widgets/_level-bar.scss b/src/stylesheet/widgets/_level-bar.scss
index 2ba0f831..4fe5de08 100644
--- a/src/stylesheet/widgets/_level-bar.scss
+++ b/src/stylesheet/widgets/_level-bar.scss
@@ -81,7 +81,7 @@ levelbar {
 
       &.high,
       &:not(.empty) {
-        background-color: $selected_bg_color;
+        background-color: $fill_color;
       }
 
       &.full {
diff --git a/src/stylesheet/widgets/_scale.scss b/src/stylesheet/widgets/_scale.scss
index dd5be84f..aa660649 100644
--- a/src/stylesheet/widgets/_scale.scss
+++ b/src/stylesheet/widgets/_scale.scss
@@ -14,7 +14,7 @@
 
 %scale_highlight {
   border-radius: 3px;
-  background-color: $selected_bg_color;
+  background-color: $fill_color;
 }
 
 scale {
@@ -67,7 +67,7 @@ scale {
       background-color: $trough_hover_color;
 
       > highlight {
-        background-color: mix($selected_bg_color, $text_color, 90%);
+        background-color: $fill_hover_color;
       }
 
       > slider {
diff --git a/src/stylesheet/widgets/_switch.scss b/src/stylesheet/widgets/_switch.scss
index 8484dd34..821b665f 100644
--- a/src/stylesheet/widgets/_switch.scss
+++ b/src/stylesheet/widgets/_switch.scss
@@ -51,13 +51,13 @@ switch {
   }
 
   &:checked {
-    color: $selected_fg_color;
-    background-color: $selected_bg_color;
+    color: $fill_text_color;
+    background-color: $fill_color;
 
     &:hover {
-      background-color: mix($selected_bg_color, $text_color, 90%);
+      background-color: $fill_hover_color;
 
-      &:active { background-color: mix($selected_bg_color, black, 80%); }
+      &:active { background-color: $fill_active_color; }
     }
 
     > slider {


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