/* Lightning Design System 0.9.1 */
// Copyright (c) 2015, salesforce.com, inc. All rights reserved.

// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
// Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
// Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
// Neither the name of salesforce.com, inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.



.#{$css-prefix}button--icon-container,
.#{$css-prefix}button--icon-border,
.#{$css-prefix}button--icon-border-filled,
.#{$css-prefix}button--icon-bare {
  vertical-align: middle;
  line-height: $line-height-reset;
}

.#{$css-prefix}button--icon-border {
  //border: $border-width-thin solid $color-border-button-default;
  //background-color: $color-background-button-icon;
// @TODO - CHECK FOR REGRESSIONS
  &[disabled] {

    &:hover,
    &:focus {
      background-color: transparent;
    }
  }
}

.#{$css-prefix}button--icon-border-filled,
.#{$css-prefix}button--icon-border {
  @include button-base;
}


.#{$css-prefix}button--icon-container,
.#{$css-prefix}button--icon-border,
.#{$css-prefix}button--icon-border-filled { // @TODO- if border-radius is placed on the icon/svg, the button element causes corner clipping problems that background-clip isn't solving
  @include square($square-icon-medium-boundary-alt);

  &:hover,
  &:focus {

    .#{$css-prefix}button__icon {
      fill: $color-text-icon-default-hover;
    }
  }

  &:active .#{$css-prefix}button__icon {
    fill: $color-text-icon-default-active;
  }

  &[disabled] .#{$css-prefix}button__icon {
    fill: $color-text-icon-default-disabled;
  }
}

.#{$css-prefix}button--icon-small {
  @include square($square-icon-medium-boundary);
}

.#{$css-prefix}button--icon-border-filled {
  background-color: $color-background-button-default;

  &[disabled] {
    border: $border-width-thin solid $color-border-button-default;
    background-color: $color-background-button-default-disabled;
  }
}

.#{$css-prefix}button__icon { // This is the icon inside the button--icon button
  @include square($square-icon-medium-content);
  fill: $color-text-icon-default;

  &--large { // Usually used for the large close button
    @include square($square-icon-utility-large);
  }

  &--small { // This creates the small down icon
    @include square($square-icon-small-content);
  }

  &--x-small { // This creates the x-small down icon that sits next to another icon
    @include square($square-icon-x-small-content);
    margin-left: $spacing-xx-small;
  }
}

.#{$css-prefix}icon--small .#{$css-prefix}button__icon {
  @include square($square-icon-small-boundary);
}
