From: Andy Cochran Date: Fri, 21 Apr 2017 17:54:15 +0000 (-0400) Subject: simplify clear button method X-Git-Tag: v6.4.0-rc1~53^2~1^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F9979%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git simplify clear button method --- diff --git a/scss/components/_button.scss b/scss/components/_button.scss index eb266c594..3ea11897b 100644 --- a/scss/components/_button.scss +++ b/scss/components/_button.scss @@ -46,10 +46,6 @@ $button-radius: $global-radius !default; /// @type Number $button-hollow-border-width: 1px !default; -/// Border width for hollow outline buttons -/// @type Number -$button-clear-border-width: 1px !default; - /// Sizes for buttons. /// @type Map $button-sizes: ( @@ -75,10 +71,6 @@ $button-background-hover-lightness: -20% !default; /// @type Number $button-hollow-hover-lightness: -50% !default; -/// Color lightness on hover for clear buttons. -/// @type Number -$button-clear-hover-lightness: -50% !default; - // Internal: flip from margin-right to margin-left for defaults @if $global-text-direction == 'rtl' { $button-margin: 0 0 $global-margin $global-margin !default; @@ -198,30 +190,6 @@ $button-transition: background-color 0.25s ease-out, color 0.25s ease-out !defau } } -/// Removes background fill on hover and focus for hollow buttons. -@mixin button-clear { - &, - &:hover, &:focus { - background-color: transparent; - } -} - -@mixin button-clear-style( - $color: $primary-color, - $hover-lightness: $button-clear-hover-lightness, - $border-width: $button-clear-border-width -) { - $color-hover: scale-color($color, $lightness: $hover-lightness); - - border: $border-width solid transparent; - color: $color; - - &:hover, &:focus { - border-color: transparent; - color: $color-hover; - } -} - /// Adds disabled styles to a button by fading the element, reseting the cursor, and disabling pointer events. /// @param [Color] $background [$button-background] - Background color of the disabled button. /// @param [Color] $color [$button-color] - Text color of the disabled button. Set to `auto` to have the mixin automatically generate a color based on the background color. @@ -350,12 +318,24 @@ $button-transition: background-color 0.25s ease-out, color 0.25s ease-out !defau // Clear style @if $button-fill != clear { &.clear { - @include button-clear; - @include button-clear-style; + @include button-hollow; + @include button-hollow-style; + + &, &:hover, &:focus { + &, &.disabled, &[disabled] { + border-color: transparent; + } + } @each $name, $color in $button-palette { &.#{$name} { - @include button-clear-style($color); + @include button-hollow-style($color); + + &, &:hover, &:focus { + &, &.disabled, &[disabled] { + border-color: transparent; + } + } } } }