@use "sass:meta";
@use "sass:color";
@use "../../modules/misc/resources/color-state" as color_state_obj;
@forward "../../modules/misc/element/index";

$link_class_name: "link" !default;
$link_variant_name_list: "primary" !default;
$link_theme_path: "theme/default" !default;

@include meta.load-css($link_theme_path);

$color_state_map: ();

@each $curr_variant_name in $link_variant_name_list {
  $color_state_map: color_state_obj.new_state($color_state_map, "norm");
  $color_state_map: color_state_obj.set_value($color_state_map, "norm", "#{$curr_variant_name}-text", var(--#{$link_class_name}-#{$curr_variant_name}-text, #333));
  $color_state_map: color_state_obj.set_value($color_state_map, "norm", "#{$curr_variant_name}-background", var(--#{$link_class_name}-#{$curr_variant_name}-background, transparent));

  $color_state_map: color_state_obj.new_state($color_state_map, "hovered");
  $color_state_map: color_state_obj.set_value($color_state_map, "hovered", "#{$curr_variant_name}-text-hovered", var(--#{$link_class_name}-#{$curr_variant_name}-text-hovered, #{color.scale(#00f, $lightness: -30%)}));
  $color_state_map: color_state_obj.set_value($color_state_map, "hovered", "#{$curr_variant_name}-background-hovered", var(--#{$link_class_name}-#{$curr_variant_name}-background-hovered, transparent));
}
