@import "./button.vars";

// Button
// --------------------------------------------------

.button {
  @include text-align(center);
  @include appearance(none);

  position: relative;
  z-index: 0;
  display: inline-block;

  border: 0;

  line-height: 1;

  text-decoration: none;
  text-overflow: ellipsis;
  text-transform: none;

  white-space: nowrap;
  cursor: pointer;
  vertical-align: top; // the better option for most scenarios
  vertical-align: -webkit-baseline-middle; // the best for those that support it

  transition: background-color, opacity 100ms linear;

  font-kerning: none;
  user-select: none;

  contain: content;

  font-smoothing: antialiased;
  -webkit-font-smoothing: antialiased;
}

.button:active,
.button:focus {
  outline: none;
}

.button-inner {
  display: flex;

  flex-flow: row nowrap;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;

  width: 100%;
  height: 100%;
}


a[disabled],
button[disabled],
.button[disabled] {
  cursor: default;

  pointer-events: none;
}


// Block Button
// --------------------------------------------------

.button-block {
  display: block;
  clear: both;

  width: 100%;

  contain: strict;
}

.button-block::after {
  clear: both;
}


// Full Button
// --------------------------------------------------

.button-full {
  display: block;

  width: 100%;

  contain: strict;
}


// Full Outline Button
// --------------------------------------------------

.button-full.button-outline {
  @include border-radius(0);

  border-right-width: 0;
  border-left-width: 0;
}


// Button Icons
// --------------------------------------------------

.button ion-icon {
  font-size: 1.4em;

  pointer-events: none;
}

.button ion-icon[slot="start"] {
  @include margin(0, .3em, 0, -.3em);
}

.button ion-icon[slot="end"] {
  @include margin(0, -.2em, 0, .3em);
}

.button ion-icon[slot="icon-only"] {
  font-size: 1.8em;
}
