This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new 61775d0  jewel-theme: improve Switch styles for non-flat themes
61775d0 is described below

commit 61775d07fb973d1c8302937431c55bbf2869787d
Author: Carlos Rovira <[email protected]>
AuthorDate: Mon Jan 4 16:19:52 2021 +0100

    jewel-theme: improve Switch styles for non-flat themes
---
 .../JewelTheme/src/main/resources/defaults.css     | 20 +++++++--------
 .../main/sass/components-primary/_checkbox.sass    | 30 ++++++++++++++--------
 2 files changed, 29 insertions(+), 21 deletions(-)

diff --git a/frameworks/themes/JewelTheme/src/main/resources/defaults.css 
b/frameworks/themes/JewelTheme/src/main/resources/defaults.css
index 381c8b7..5e569b7 100644
--- a/frameworks/themes/JewelTheme/src/main/resources/defaults.css
+++ b/frameworks/themes/JewelTheme/src/main/resources/defaults.css
@@ -436,16 +436,19 @@ j|CardActions {
 }
 
 .jewel.switch input:checked + .switch {
-  background-color: #3CADF1;
+  background: linear-gradient(#3cadf1, #6cc1f4);
+  box-shadow: 0px 0px 0px 1px #24a3ef;
 }
 .jewel.switch input:focus + .switch {
-  box-shadow: 0 0 1px #3CADF1;
+  box-shadow: 0px 0px 0px 1px #1198e9;
 }
 .jewel.switch input:checked + .switch::before {
+  background: white;
   transform: translateX(20px);
 }
 .jewel.switch input[disabled]:checked + .switch {
-  background-color: silver;
+  background: linear-gradient(silver, #d9d9d9);
+  box-shadow: 0px 0px 0px 1px #b3b3b3;
 }
 .jewel.switch input[disabled] + .switch {
   color: silver;
@@ -454,16 +457,13 @@ j|CardActions {
   background: #f3f3f3;
 }
 .jewel.switch .switch {
-  background-color: #d9d9d9;
-  transition: 0.4s;
+  background: linear-gradient(#d9d9d9, #f3f3f3);
+  box-shadow: 0px 0px 0px 1px #cccccc;
   border-radius: 20px;
+  transition: 0.4s;
 }
 .jewel.switch .switch::before {
-  height: 20px;
-  width: 20px;
-  left: 2px;
-  bottom: 2px;
-  background-color: white;
+  background: #fafdff;
   transition: 0.4s;
   border-radius: 50%;
 }
diff --git 
a/frameworks/themes/JewelTheme/src/main/sass/components-primary/_checkbox.sass 
b/frameworks/themes/JewelTheme/src/main/sass/components-primary/_checkbox.sass
index 34ad2c4..1276dec 100644
--- 
a/frameworks/themes/JewelTheme/src/main/sass/components-primary/_checkbox.sass
+++ 
b/frameworks/themes/JewelTheme/src/main/sass/components-primary/_checkbox.sass
@@ -95,20 +95,29 @@ $switch-label-separation: 8px
     input
         &:checked 
             + .switch
-                background-color: $primary-color
+                @if $flat
+                    background: $primary-color
+                @else
+                    background: linear-gradient(lighten($primary-color, 0%), 
lighten($primary-color, 10%))
+                    box-shadow: 0px 0px 0px 1px darken($primary-color, 5%)
 
         &:focus
             + .switch
-                box-shadow: 0 0 1px $primary-color
+                box-shadow: 0px 0px 0px 1px darken($primary-color, 10%)
 
         &:checked 
             + .switch::before
+                background: lighten($primary-color, 50%)
                 transform: translateX($switch-inner-size)
 
         &[disabled]
             &:checked 
                 + .switch
-                    background-color: $disabled-font-color
+                    @if $flat
+                        background: $disabled-font-color
+                    @else
+                        background: 
linear-gradient(lighten($disabled-font-color, 0%), 
lighten($disabled-font-color, 10%))
+                    box-shadow: 0px 0px 0px 1px darken($disabled-font-color, 
5%)
 
             & + .switch
                 color: $disabled-font-color
@@ -117,17 +126,16 @@ $switch-label-separation: 8px
                 background: $disabled-color
 
     .switch
-        background-color: $default-color
-        transition: $switch-transition-delay
-
+        @if $flat
+            background: lighten($default-color, 15%)
+        @else
+            background: linear-gradient(lighten($default-color, 0%), 
lighten($default-color, 10%))
+            box-shadow: 0px 0px 0px 1px darken($default-color, 5%)
         border-radius: $switch-inner-size
+        transition: $switch-transition-delay
 
     .switch::before
-        height: $switch-inner-size
-        width: $switch-inner-size
-        left: $switch-button-offset
-        bottom: $switch-button-offset
-        background-color: lighten($primary-color, 50%)
+        background: lighten($primary-color, 40%)
         transition: $switch-transition-delay
         border-radius: $switch-button-border-radius
        

Reply via email to