@import "../../themes/ionic.globals";
@import "./refresher.vars";

ion-refresher {
  @include position(0, null, null, 0);

  position: absolute;
  top: 0;
  z-index: $z-index-refresher;

  display: none;

  width: 100%;
  height: $refresher-height;

  &.refresher-active {
    display: block;
  }
}

// Refresher Content
// --------------------------------------------------

ion-refresher-content {
  display: flex;

  flex-direction: column;
  justify-content: center;

  height: 100%;
}

.refresher-pulling,
.refresher-refreshing {
  display: none;

  width: 100%;
}

.refresher-pulling-icon,
.refresher-refreshing-icon {
  @include text-align(center);
  @include transform-origin(center);

  font-size: $refresher-icon-font-size;
  transition: 200ms;
}

.refresher-pulling-text,
.refresher-refreshing-text {
  @include text-align(center);

  font-size: $refresher-text-font-size;
}

// Refresher Content States
// --------------------------------------------------

.refresher-pulling ion-refresher-content {
  .refresher-pulling {
    display: block;
  }
}

.refresher-ready  ion-refresher-content {
  .refresher-pulling {
    display: block;
  }

  .refresher-pulling-icon {
    transform: rotate(180deg);
  }
}

.refresher-refreshing  ion-refresher-content {
  .refresher-refreshing {
    display: block;
  }
}

.refresher-cancelling ion-refresher-content {
  .refresher-pulling {
    display: block;
  }

  .refresher-pulling-icon {
    transform: scale(0);
  }
}

.refresher-completing ion-refresher-content {
  .refresher-refreshing {
    display: block;
  }

  .refresher-refreshing-icon {
    transform: scale(0);
  }
}
