@use "variables" as *;

/// Link mixin
/// @param {Boolean} $light use global link color
/// @param {Boolean} $dark use global link color dark
/// @param {String} $decoration text-decoration, default none
@mixin link($light, $dark, $decoration: none) {
  $link-color-light: $single-link-color;
  $link-color-dark: $single-link-color-dark;
  $link-hover-color-light: $single-link-hover-color;
  $link-hover-color-dark: $single-link-hover-color-dark;

  @if $light {
    $link-color-light: $global-link-color;
    $link-hover-color-light: $global-link-hover-color;
  }

  @if $dark {
    $link-color-dark: $global-link-color-dark;
    $link-hover-color-dark: $global-link-hover-color-dark;
  }

  a,
  a::before,
  a::after {
    text-decoration: $decoration;
    color: light-dark($link-color-light, $link-color-dark);
  }

  a:active,
  a:hover {
    color: light-dark($link-hover-color-light, $link-hover-color-dark);
  }
}
