]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Changes requested by @ncoden
authorJ. Eric Ellis <jellisii@gmail.com>
Wed, 21 Feb 2018 14:12:20 +0000 (09:12 -0500)
committerJ. Eric Ellis <jellisii@gmail.com>
Wed, 21 Feb 2018 14:12:20 +0000 (09:12 -0500)
Added variables for switch-cursor-disabled and switch-opacity-disabled.

Altered css selector to use class instead of element.

Added reduced opacity for disabled switches.

Fixed line spacing for comment.

scss/components/_switch.scss

index 4b62160c77f89040abaabd3809b978561f86431a..481e0dc775369a0e197d157f9ee23ab473c6a22c 100644 (file)
@@ -54,6 +54,14 @@ $switch-paddle-radius: $global-radius !default;
 /// @type Number
 $switch-paddle-transition: all 0.25s ease-out !default;
 
+/// Opacity of a disabled switch.
+/// @type Number
+$switch-opacity-disabled: .5 !default;
+
+/// Cursor for a disabled switch.
+/// @type Cursor
+$switch-cursor-disabled: not-allowed !default;
+
 // make them variables
 // ask about accessibility on label
 // change class name for text
@@ -208,9 +216,10 @@ $switch-paddle-transition: all 0.25s ease-out !default;
   // <input> element
   .switch-input {
     @include switch-input;
-      // indicate a disabled switch
-    &:disabled ~ label {
-      cursor: not-allowed;
+    // indicate a disabled switch
+    &:disabled ~ .switch-paddle {
+      cursor: $switch-cursor-disabled;
+      opacity: $switch-opacity-disabled;
     }
   }