]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Mixin comments for button disabled. Using background and color simultaneously
authorharry <harmanmanchanda182@gmail.com>
Sat, 14 Jan 2017 21:42:28 +0000 (03:12 +0530)
committerharry <harmanmanchanda182@gmail.com>
Sat, 14 Jan 2017 21:42:28 +0000 (03:12 +0530)
scss/components/_button.scss

index cdb4295ba50dbdd86443ed7cf5cc143c0fb6560a..23f475875c648888e9d23e506a466d070d783368 100644 (file)
@@ -158,22 +158,22 @@ $button-transition: background-color 0.25s ease-out, color 0.25s ease-out !defau
 }
 
 /// Adds disabled styles to a button by fading the element, reseting the cursor, and disabling pointer events.
+/// @param [Color] $background [$primary-color] - Background color of the disabled button. Set to `auto` to have the mixin automatically generate a hover color.
+/// @param [Color] $color [$button-color] - Text color of the disabled button. Set to `auto` to have the mixin automatically generate a hover color.
 @mixin button-disabled(
   $background: $primary-color,
   $color: $button-color
 ) {
   opacity: $button-opacity-disabled;
   cursor: not-allowed;
-  background-color: $background;
-  
-  @if $color == auto {
-    $color: color-pick-contrast($background, ($button-color, $button-color-alt));
-  }
 
-  color: $color;
-
-  &:hover, &:focus {
+  &, &:hover, &:focus {
     background-color: $background;
+  
+    @if $color == auto {
+      $color: color-pick-contrast($background, ($button-color, $button-color-alt));
+    }
+
     color: $color;
   }
 }