@use "../functions"; @use "../variables"; // All-caps `RGBA()` function used because of this Sass bug: https://github.com/sass/node-sass/issues/2251 @each $color, $value in variables.$theme-colors { .link-#{$color} { color: RGBA(var(--#{variables.$prefix}#{$color}-rgb), var(--#{variables.$prefix}link-opacity, 1)) if(variables.$enable-important-utilities, !important, null); text-decoration-color: RGBA(var(--#{variables.$prefix}#{$color}-rgb), var(--#{variables.$prefix}link-underline-opacity, 1)) if(variables.$enable-important-utilities, !important, null); @if variables.$link-shade-percentage != 0 { &:hover, &:focus { $hover-color: if(functions.color-contrast($value) == variables.$color-contrast-light, functions.shade-color($value, variables.$link-shade-percentage), functions.tint-color($value, variables.$link-shade-percentage)); color: RGBA(#{functions.to-rgb($hover-color)}, var(--#{variables.$prefix}link-opacity, 1)) if(variables.$enable-important-utilities, !important, null); text-decoration-color: RGBA(functions.to-rgb($hover-color), var(--#{variables.$prefix}link-underline-opacity, 1)) if(variables.$enable-important-utilities, !important, null); } } } } // One-off special link helper as a bridge until v6 .link-body-emphasis { color: RGBA(var(--#{variables.$prefix}emphasis-color-rgb), var(--#{variables.$prefix}link-opacity, 1)) if(variables.$enable-important-utilities, !important, null); text-decoration-color: RGBA(var(--#{variables.$prefix}emphasis-color-rgb), var(--#{variables.$prefix}link-underline-opacity, 1)) if(variables.$enable-important-utilities, !important, null); @if variables.$link-shade-percentage != 0 { &:hover, &:focus { color: RGBA(var(--#{variables.$prefix}emphasis-color-rgb), var(--#{variables.$prefix}link-opacity, .75)) if(variables.$enable-important-utilities, !important, null); text-decoration-color: RGBA(var(--#{variables.$prefix}emphasis-color-rgb), var(--#{variables.$prefix}link-underline-opacity, .75)) if(variables.$enable-important-utilities, !important, null); } } }