@use 'spacing' as *;
@use 'theme' as *;
@use 'transition' as *;
@use './ds-internal/_link' as *;






@mixin link($variant: 'neutral', $theme: 'light') {
  display: inline;
  padding-inline-end: $spacing-2;
  padding-inline-start: $spacing-2;
  padding-block-start: 0;
  padding-block-end: 0;
  line-height: inherit;
  font-size: inherit;

  
  @include link-underline;

  
  
  
  
  
  :where(&)[href^='http://']::after,
  :where(&)[href^='https://']::after,
  :where(&)[href^='#']::after {
    display: inline-block;
    margin-inline-start: 0.375em;
    width: 0.75em;
    height: 0.75em;
  }

  
  @if ($variant == 'neutral' and $theme == 'light') {
    @include link-variant(
      $theme-light-content-color-interaction-neutral,
      $theme-light-background-color-transparent-hover,
      $theme-light-content-color-interaction-neutral
    );
  }

  @if ($variant == 'highlight' and $theme == 'light') {
    @include link-variant(
      $theme-light-content-color-interaction-accent,
      $theme-light-background-color-transparent-hover,
      $theme-light-content-color-interaction-accent-hover
    );
  }

  @if ($variant == 'neutral' and $theme == 'dark') {
    @include link-variant(
      $theme-dark-content-color-interaction-neutral,
      $theme-dark-background-color-transparent-hover,
      $theme-dark-content-color-interaction-neutral,
      $theme: 'dark'
    );
  }

  @if ($variant == 'highlight' and $theme == 'dark') {
    @include link-variant(
      $theme-dark-content-color-interaction-accent,
      $theme-dark-background-color-transparent-hover,
      $theme-dark-content-color-interaction-accent,
      $theme: 'dark'
    );
  }

  
  @include transition((background-color, border-color, color));
}
