@import "../../../themes/ionic.globals.wp";

// Windows FAB Button
// --------------------------------------------------

/// @prop - Background color of the button
$fab-wp-background-color: color($colors-wp, primary) !default;

/// @prop - Text color of the button
$fab-wp-text-color: color-contrast($colors-wp, $fab-wp-background-color) !default;

/// @prop - Background color of the activated button
$fab-wp-background-color-activated: color-shade($fab-wp-background-color) !default;

/// @prop - Background color of the button in a list
$fab-wp-list-button-background-color: $fab-list-button-background-color !default;

/// @prop - Text color of the button in a list
$fab-wp-list-button-text-color: color-contrast($colors-wp, $fab-wp-list-button-background-color) !default;

/// @prop - Background color of the activated button in a list
$fab-wp-list-button-background-color-activated: color-shade($fab-wp-list-button-background-color) !default;

/// @prop - Transition duration of the transform and opacity of the button in a list
$fab-wp-list-button-transition-duration: 200ms !default;

/// @prop - Speed curve of the transition of the transform and opacity of the button in a list
$fab-wp-list-button-transition-timing-function: ease !default;

/// @prop - Transition delay of the transform and opacity of the button in a list
$fab-wp-list-button-transition-delay: 10ms !default;

.fab-wp {
  color: $fab-wp-text-color;
  background-color: $fab-wp-background-color;
}

.fab-wp:active {
  background-color: $fab-wp-background-color-activated;
}

.fab-wp-in-list {
  color: $fab-wp-list-button-text-color;
  background-color: $fab-wp-list-button-background-color;
  transition:
    transform $fab-wp-list-button-transition-duration $fab-wp-list-button-transition-timing-function $fab-wp-list-button-transition-delay,
    opacity $fab-wp-list-button-transition-duration $fab-wp-list-button-transition-timing-function $fab-wp-list-button-transition-delay;
}

.fab-wp-in-list:active {
  background-color: $fab-wp-list-button-background-color-activated;
}

// Generate WP FAB colors
// --------------------------------------------------

@each $color-name, $color-base, $color-contrast in get-colors($colors-wp) {

  $bg-color: $color-base;
  $bg-color-activated: color-shade($bg-color);
  $fg-color: $color-contrast;

  .fab-wp-#{$color-name} {
    color: $fg-color;
    background-color: $bg-color;
  }

  .fab-wp-#{$color-name}:active {
    background-color: $bg-color-activated;
  }
}
