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

// iOS Label
// --------------------------------------------------

$label-ios-text-color:         #7f7f7f !default;
$label-ios-margin:             $item-ios-padding-top ($item-ios-padding-right / 2) $item-ios-padding-bottom 0 !default;


// iOS Default Label
// --------------------------------------------------

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


// iOS Default Label Inside An Input/Select Item
// --------------------------------------------------

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

ion-label + ion-input .text-input,
ion-label + ion-textarea .text-input {
  margin-left: $item-ios-padding-left;

  width: calc(100% - (#{$item-ios-padding-right} / 2) - #{$item-ios-padding-left});
}


// iOS Stacked & Floating Labels
// --------------------------------------------------

ion-label[stacked] {
  margin-bottom: 4px;

  font-size: 1.2rem;
}

ion-label[floating] {
  margin-bottom: 0;

  transform: translate3d(0, 27px, 0);
  transform-origin: left top;
  transition: transform 150ms ease-in-out;
}

.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-ios-padding-media-top - 2;
  margin-bottom: $item-ios-padding-media-bottom - 2;
}


// Generate iOS Label colors
// --------------------------------------------------

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

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

}
