@use "../helpers/functions" as fn;

// Popover
@mixin popover-desktop($transitionName) {
  .#{$transitionName}-enter-active,
  .#{$transitionName}-leave-active {
    transition: 200ms cubic-bezier(0.175, 0.885, 0.32, 1.175);
    transition-property: opacity, transform;
  }

  .#{$transitionName}-enter-from {
    transform: scale(0.8);
  }

  .#{$transitionName}-enter-to {
    transform: scale(1);
  }

  .#{$transitionName}-leave-to {
    opacity: 0;
  }

  .#{$transitionName}-leave-from {
    opacity: 1;
  }
}

@mixin square-sizing($icon-size) {
  width: fn.px-to-rem($icon-size);

  // todo: remove when aspect-ratio property is more than 95% supported
  height: fn.px-to-rem($icon-size);
  aspect-ratio: 1 / 1;
}

// Floating Vue
@mixin hide-tooltip-arrow() {
  .v-popper__arrow-container {
    display: none;
  }
}

@mixin v-dropdown-transition() {
  .v-popper__wrapper {
    transition: scale 200ms var(--cp-easing-elastic), opacity 200ms ease;
  }

  .v-popper__popper--hidden .v-popper__wrapper {
    opacity: 0;
    scale: 0.9;
  }
}

// Media queries
@mixin media-query-min($breakpoint) {
  @media (min-width: $breakpoint) {
    @content;
  }
}

@mixin media-query-max($breakpoint) {
  @media (max-width: $breakpoint) {
    @content;
  }
}

@mixin media-query-between($breakpoint-min, $breakpoint-max) {
  @media (min-width: $breakpoint-min) and (max-width: $breakpoint-max) {
    @content;
  }
}

@mixin media-query-pointer-device-only {
  @media (hover: hover) and (pointer: fine) {
    @content;
  }
}
