[libadwaita/wip/exalm/stylesheet-cleanups] stylesheet: Extract slider colors



commit 6fc3cd52221e31bd6c225bdef859b3811a2efbda
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Fri May 21 15:24:47 2021 +0500

    stylesheet: Extract slider colors
    
    Make the active switch slider always light instead of using fill text
    color.

 src/stylesheet/_colors.scss         | 2 ++
 src/stylesheet/widgets/_scale.scss  | 4 ++--
 src/stylesheet/widgets/_switch.scss | 6 +++---
 3 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/src/stylesheet/_colors.scss b/src/stylesheet/_colors.scss
index 9651495f..c6f0e18f 100644
--- a/src/stylesheet/_colors.scss
+++ b/src/stylesheet/_colors.scss
@@ -28,6 +28,8 @@ $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%);
+$slider_color: mix(white, $base_color, 80%);
+$slider_hover_color: white;
 
 $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/_scale.scss b/src/stylesheet/widgets/_scale.scss
index aa660649..e8c5e4b9 100644
--- a/src/stylesheet/widgets/_scale.scss
+++ b/src/stylesheet/widgets/_scale.scss
@@ -47,7 +47,7 @@ scale {
     }
 
     > slider {
-      background-color: mix(white, $base_color, 80%);
+      background-color: $slider_color;
       box-shadow: 0 2px 4px transparentize(black, .8);
       outline: 1px solid transparentize(black, .9);
 
@@ -71,7 +71,7 @@ scale {
       }
 
       > slider {
-        background-color: white;
+        background-color: $slider_hover_color;
       }
     }
   }
diff --git a/src/stylesheet/widgets/_switch.scss b/src/stylesheet/widgets/_switch.scss
index 821b665f..98cae5f7 100644
--- a/src/stylesheet/widgets/_switch.scss
+++ b/src/stylesheet/widgets/_switch.scss
@@ -38,7 +38,7 @@ switch {
     min-width: 22px;
     min-height: 22px;
     border-radius: 50%;
-    background-color: mix(white, $base_color, 80%);
+    background-color: $slider_color;
     box-shadow: 0 2px 4px transparentize(black, .8);
 
     &:disabled {
@@ -47,7 +47,7 @@ switch {
   }
 
   &:hover > slider {
-    background: white;
+    background: $slider_hover_color;
   }
 
   &:checked {
@@ -61,7 +61,7 @@ switch {
     }
 
     > slider {
-      background-color: $selected_fg_color;
+      background-color: $slider_hover_color;
     }
   }
 }


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