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

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

:host(.ion-text-wrap),
:host([text-wrap]) {
  line-height: $label-md-text-wrap-line-height;
}


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

:host(.label-stacked) {
  @include transform-origin(start, top);
  @include transform(translate3d(0, 50%, 0), scale(.75));

  transition: color 150ms $label-md-transition-timing-function;
}

:host(.label-floating) {
  @include transform(translate3d(0, 96%, 0));
  @include transform-origin(start, top);

  transition:
    color 150ms $label-md-transition-timing-function,
    transform 150ms $label-md-transition-timing-function;
}

:host(.label-stacked),
:host(.label-floating) {
  @include margin(0, 0, 0, 0);
}

:host-context(.item-select).label-floating {
  @include transform(translate3d(0, 130%, 0));
}

:host-context(.item-has-focus).label-floating,
:host-context(.item-has-placeholder).label-floating,
:host-context(.item-has-value).label-floating {
  @include transform(translate3d(0, 50%, 0), scale(.75));
}

:host-context(.item-has-focus).label-stacked,
:host-context(.item-has-focus).label-floating {
  color: $label-md-text-color-focused;
}


// MD Typography
// --------------------------------------------------

::slotted(*) h1 {
  @include margin(0, 0, 2px);

  font-size: 24px;
  font-weight: normal;
}

::slotted(*) h2 {
  @include margin(2px, 0);

  font-size: 16px;
  font-weight: normal;
}

::slotted(*) h3,
::slotted(*) h4,
::slotted(*) h5,
::slotted(*) h6 {
  @include margin(2px, 0);

  font-size: 14px;
  font-weight: normal;

  line-height: normal;
}

::slotted(*) p {
  @include margin(0, 0, 2px);

  font-size: 14px;

  line-height: 20px;

  text-overflow: inherit;

  overflow: inherit;
}

::slotted(p) {
  color: $item-md-paragraph-text-color;
}

:host-context(.ion-color)::slotted(p) {
  color: inherit;
}
