@import "../../globals.md";
@import "./label";

// Material Design Label
// --------------------------------------------------

$label-md-text-color:                 #999 !default;
$label-md-text-color-focused:         color($colors-md, primary) !default;
$label-md-margin:                     $item-md-padding-top ($item-md-padding-right / 2) $item-md-padding-bottom 0 !default;


// Material Design Default Label
// --------------------------------------------------

ion-label {
  margin: $label-md-margin;
}

[text-wrap] ion-label {
  font-size: $item-md-body-text-font-size;
  line-height: $item-md-body-text-line-height;
}

// Material Design Default Label Inside An Input/Select Item
// --------------------------------------------------

.item-input ion-label,
.item-select ion-label {
  color: $label-md-text-color;
}


// Material Design Stacked & Floating Labels
// --------------------------------------------------

ion-label[stacked] {
  font-size: 1.2rem;
}

ion-label[floating] {
  transform: translate3d(0, 27px, 0);
  transform-origin: left top;
  transition: transform 150ms ease-in-out;
}

ion-label[stacked],
ion-label[floating] {
  margin-bottom: 0;
  margin-left: 0;
}

.input-has-focus ion-label[stacked],
.input-has-focus ion-label[floating] {
  color: $label-md-text-color-focused;
}

.input-has-focus ion-label[floating],
.input-has-value ion-label[floating] {
  transform: translate3d(0, 0, 0) scale(.8);
}

.item-label-stacked [item-right],
.item-label-floating [item-right] {
  margin-top: $item-md-padding-media-top - 2;
  margin-bottom: $item-md-padding-media-bottom - 2;
}


// Generate Material Design Label colors
// --------------------------------------------------

@each $color-name, $color-base, $color-contrast in get-colors($colors-md) {

  ion-label[#{$color-name}] {
    color: $color-base;
  }

}
