// Hide Carbon's `::before` feedback caret when using a portalled tooltip.
// `_tooltip.scss` loads before `carbon-components/.../styles`, so Carbon's
// `.bx--copy-btn.bx--copy-btn--animating::before { display: block }` was
// winning over `.bx--copy-btn--portal-active::before { display: none }`.

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

@mixin copy-button-portal {
  .#{$prefix}--copy-btn.#{$prefix}--copy-btn--portal-active.#{$prefix}--copy-btn--animating::before,
  .#{$prefix}--copy-btn.#{$prefix}--copy-btn--portal-active .#{$prefix}--copy-btn__feedback,
  .#{$prefix}--copy-btn.#{$prefix}--copy-btn--portal-active.#{$prefix}--copy-btn--animating
    .#{$prefix}--copy-btn__feedback,
  // The inline code snippet variant renders its own button without the
  // `bx--copy-btn` class, so the rules above do not reach it. Carbon's
  // `.bx--snippet--inline.bx--copy-btn--animating::before` still shows the
  // native caret beside the portalled tooltip.
  .#{$prefix}--snippet--inline.#{$prefix}--copy-btn--portal-active.#{$prefix}--copy-btn--animating::before,
  .#{$prefix}--snippet--inline.#{$prefix}--copy-btn--portal-active
    .#{$prefix}--copy-btn__feedback,
  .#{$prefix}--snippet--inline.#{$prefix}--copy-btn--portal-active.#{$prefix}--copy-btn--animating
    .#{$prefix}--copy-btn__feedback {
    display: none;
  }
}

@include exports("copy-button-portal") {
  @include copy-button-portal;
}
