2025-08-28 12:14:59 +08:00
|
|
|
@use "../config" as *;
|
|
|
|
|
@use "../colors" as *;
|
|
|
|
|
@use "../variables" as *;
|
|
|
|
|
|
2023-01-04 14:23:46 +08:00
|
|
|
// All-caps `RGBA()` function used because of this Sass bug: https://github.com/sass/node-sass/issues/2251
|
2025-08-28 12:14:59 +08:00
|
|
|
@layer helpers {
|
|
|
|
|
@each $color, $value in $theme-colors {
|
|
|
|
|
.link-#{$color} {
|
|
|
|
|
color: color-mix(in srgb, var(--#{$prefix}#{$color}), transparent var(--#{$prefix}link-opacity));
|
|
|
|
|
text-decoration-color: color-mix(in srgb, var(--#{$prefix}#{$color}), transparent var(--#{$prefix}link-underline-opacity));
|
2019-08-18 02:19:00 +08:00
|
|
|
|
2025-08-28 12:14:59 +08:00
|
|
|
@if $link-shade-percentage != 0 {
|
|
|
|
|
&:hover,
|
|
|
|
|
&:focus {
|
|
|
|
|
$hover-color: if(color-contrast($value) == $color-contrast-light, shade-color($value, $link-shade-percentage), tint-color($value, $link-shade-percentage));
|
|
|
|
|
color: color-mix(in srgb, $hover-color, transparent var(--#{$prefix}link-opacity));
|
|
|
|
|
text-decoration-color: color-mix(in srgb, $hover-color, transparent var(--#{$prefix}link-underline-opacity));
|
|
|
|
|
}
|
2019-08-18 02:19:00 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-01-11 08:34:25 +08:00
|
|
|
|
2025-08-28 12:14:59 +08:00
|
|
|
// One-off special link helper as a bridge until v6
|
|
|
|
|
.link-body-emphasis {
|
|
|
|
|
color: color-mix(in srgb, var(--#{$prefix}emphasis-color), transparent var(--#{$prefix}link-opacity));
|
|
|
|
|
text-decoration-color: color-mix(in srgb, var(--#{$prefix}emphasis-color), transparent var(--#{$prefix}link-underline-opacity));
|
2023-01-11 08:34:25 +08:00
|
|
|
|
2025-08-28 12:14:59 +08:00
|
|
|
@if $link-shade-percentage != 0 {
|
|
|
|
|
&:hover,
|
|
|
|
|
&:focus {
|
|
|
|
|
color: color-mix(in srgb, var(--#{$prefix}emphasis-color), transparent var(--#{$prefix}link-opacity, .75));
|
|
|
|
|
text-decoration-color: color-mix(in srgb, var(--#{$prefix}emphasis-color), transparent var(--#{$prefix}link-underline-opacity, .75));
|
|
|
|
|
}
|
2023-01-11 08:34:25 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|