Quellcode durchsuchen

css update to switch slider

Torkel Ödegaard vor 7 Jahren
Ursprung
Commit
810e256787
2 geänderte Dateien mit 16 neuen und 15 gelöschten Zeilen
  1. 1 1
      public/app/core/components/switch.ts
  2. 15 14
      public/sass/components/_switch.scss

+ 1 - 1
public/app/core/components/switch.ts

@@ -9,7 +9,7 @@ const template = `
 </label>
 </label>
 <div class="gf-form-switch {{ctrl.switchClass}}" ng-if="ctrl.show">
 <div class="gf-form-switch {{ctrl.switchClass}}" ng-if="ctrl.show">
   <input id="check-{{ctrl.id}}" type="checkbox" ng-model="ctrl.checked" ng-change="ctrl.internalOnChange()">
   <input id="check-{{ctrl.id}}" type="checkbox" ng-model="ctrl.checked" ng-change="ctrl.internalOnChange()">
-  <label for="check-{{ctrl.id}}" data-on="Yes" data-off="No"></label>
+  <span class="gf-from-switch__slider" for="check-{{ctrl.id}}" data-on="Yes" data-off="No"></span>
 </div>
 </div>
 `;
 `;
 
 

+ 15 - 14
public/sass/components/_switch.scss

@@ -93,7 +93,7 @@ gf-form-switch[disabled] {
   display: inline-block;
   display: inline-block;
   width: 60px;
   width: 60px;
   height: 34px;
   height: 34px;
-  border-radius: 34px;
+  background: black;
 
 
   input {
   input {
     opacity: 0;
     opacity: 0;
@@ -106,28 +106,29 @@ gf-form-switch[disabled] {
 .gf-form-switch__slider {
 .gf-form-switch__slider {
   position: absolute;
   position: absolute;
   cursor: pointer;
   cursor: pointer;
-  top: 0;
-  left: 0;
-  right: 0;
-  bottom: 0;
-  background: $dark-3;
+  top: 8px;
+  left: 14px;
+  right: 10px;
+  bottom: 10px;
+  background: #1d1d1d;
   transition: 0.4s;
   transition: 0.4s;
+  border-radius: 34px;
 
 
   &::before {
   &::before {
     position: absolute;
     position: absolute;
     content: '';
     content: '';
-    height: 26px;
-    width: 26px;
-    left: 4px;
-    bottom: 4px;
-    background: $dark-4;
+    height: 16px;
+    width: 16px;
+    left: 2px;
+    bottom: 0px;
+    background: #333333;
     transition: 0.4s;
     transition: 0.4s;
     border-radius: 50%;
     border-radius: 50%;
   }
   }
 }
 }
 
 
 input:checked + .gf-form-switch__slider {
 input:checked + .gf-form-switch__slider {
-  background-color: $dark-5;
+  background: linear-gradient(90deg, $orange, $red);
 }
 }
 
 
 /* input:focus + .gf-form-switch__slider { */
 /* input:focus + .gf-form-switch__slider { */
@@ -135,6 +136,6 @@ input:checked + .gf-form-switch__slider {
 /* } */
 /* } */
 
 
 input:checked + .gf-form-switch__slider:before {
 input:checked + .gf-form-switch__slider:before {
-  transform: translateX(26px);
-  background: $blue;
+  transform: translateX(20px);
+  box-shadow: 0 0 5px black;
 }
 }