]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Added color pick contrast for the sake of a11y-compliant
authorharry <harmanmanchanda182@gmail.com>
Sat, 14 Jan 2017 18:14:32 +0000 (23:44 +0530)
committerharry <harmanmanchanda182@gmail.com>
Sat, 14 Jan 2017 18:14:32 +0000 (23:44 +0530)
scss/components/_button.scss

index 91d1b9adcdcf02eb5875ca9c9b6ee677560c0d3e..5a10d24d7962c15e3402df23b9b167cf529ee521 100644 (file)
@@ -158,10 +158,18 @@ $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.
-@mixin button-disabled($color: $primary-color) {
+@mixin button-disabled(
+  $background: $primary-color,
+  $color: $button-color
+) {
   opacity: $button-opacity-disabled;
   cursor: not-allowed;
-  background-color: $color;
+  background-color: $background;
+  
+  $color: color-pick-contrast($background, ($button-color, $button-color-alt));
+
+  color: $color;
+
   &:hover, &:focus {
     box-shadow:none;
   }