|
3 | 3 | // All-caps `RGBA()` function used because of this Sass bug: https://github.com/sass/node-sass/issues/2251
|
4 | 4 | @each $color, $value in $theme-colors {
|
5 | 5 | .link-#{$color} {
|
6 |
| - --#{$prefix}link-color-rgb: #{to-rgb($value)}; |
7 |
| - text-decoration-color: RGBA(to-rgb($value), var(--#{$prefix}link-underline-opacity, 1)); |
| 6 | + color: RGBA(var(--#{$prefix}#{$color}-rgb, var(--#{$prefix}link-opacity, 1))); |
| 7 | + text-decoration-color: RGBA(var(--#{$prefix}#{$color}-rgb), var(--#{$prefix}link-underline-opacity, 1)); |
8 | 8 |
|
9 | 9 | @if $link-shade-percentage != 0 {
|
10 | 10 | &:hover,
|
11 | 11 | &:focus {
|
12 | 12 | $hover-color: if(color-contrast($value) == $color-contrast-light, shade-color($value, $link-shade-percentage), tint-color($value, $link-shade-percentage));
|
13 |
| - --#{$prefix}link-color-rgb: #{to-rgb($hover-color)}; |
| 13 | + color: RGBA(#{to-rgb($hover-color)}, var(--#{$prefix}link-opacity, 1)); |
14 | 14 | text-decoration-color: RGBA(to-rgb($hover-color), var(--#{$prefix}link-underline-opacity, 1));
|
15 | 15 | }
|
16 | 16 | }
|
17 | 17 | }
|
18 | 18 | }
|
| 19 | + |
| 20 | +// One-off special link helper as a bridge until v6 |
| 21 | +.link-body-emphasis { |
| 22 | + color: RGBA(var(--#{$prefix}emphasis-color-rgb), var(--#{$prefix}link-opacity, 1)); |
| 23 | + text-decoration-color: RGBA(var(--#{$prefix}emphasis-color-rgb), var(--#{$prefix}link-underline-opacity, 1)); |
| 24 | + |
| 25 | + @if $link-shade-percentage != 0 { |
| 26 | + &:hover, |
| 27 | + &:focus { |
| 28 | + color: RGBA(var(--#{$prefix}emphasis-color-rgb), var(--#{$prefix}link-opacity, .75)); |
| 29 | + text-decoration-color: RGBA(var(--#{$prefix}emphasis-color-rgb), var(--#{$prefix}link-underline-opacity, .75)); |
| 30 | + } |
| 31 | + } |
| 32 | +} |
0 commit comments