@import "carbon-components/scss/globals/scss/vars";
@import "carbon-components/scss/globals/scss/helper-mixins";
@import "carbon-components/scss/globals/scss/vendor/@carbon/elements/scss/import-once/import-once";

/// MenuButton trigger (v10 has no `.bx--menu-button` styles to vendor).
/// Rotates the trigger's chevron icon while the menu is open.
/// @access private
/// @group components
@mixin menu-button {
  .#{$prefix}--menu-button__trigger .#{$prefix}--btn__icon {
    transition: transform $duration--fast-01 motion(standard, productive);
  }

  .#{$prefix}--menu-button__trigger--open .#{$prefix}--btn__icon {
    transform: rotate(180deg);
  }

  // Extra-small (Carbon React size="xs", 24px). Neither Button's "small"
  // class (32px) nor any other Button size lands on 24px, so shrink further
  // on top of the "small" size already passed to the trigger.
  .#{$prefix}--menu-button__trigger--xs {
    min-height: to-rem(24px);
    padding-top: 0;
    padding-bottom: 0;
  }
}

@include exports("menu-button") {
  @include menu-button;
}
