Skip to content

Commit 46b2ee5

Browse files
committed
Fix icon-link underline color referencing a nonexistent v5 variable
.icon-link relied on the removed --link-color-rgb and --link-opacity variables, so its underline never picked up custom link colors. Use color-mix() against --link-color instead.
1 parent f414ed5 commit 46b2ee5

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

scss/helpers/_icon-link.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ $icon-link-tokens: defaults(
2525
display: inline-flex;
2626
gap: var(--icon-link-gap);
2727
align-items: center;
28-
text-decoration-color: rgba(var(--link-color-rgb), var(--link-opacity, .5));
28+
text-decoration-color: color-mix(in oklch, var(--link-color) 50%, transparent);
2929
text-underline-offset: var(--icon-link-underline-offset);
3030
backface-visibility: hidden;
3131

site/src/content/docs/helpers/icon-link.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ Customize the hover `transform` by overriding the `--bs-icon-link-transform` CSS
5959
Icon link
6060
</a>`} />
6161

62-
Customize the color by overriding the `--bs-link-*` CSS variable:
62+
The icon link’s underline color is derived from `--bs-link-color`, so overriding it updates both the text and the underline together:
6363

64-
<Example code={`<a class="icon-link icon-link-hover" style="--bs-link-hover-color-rgb: 25, 135, 84;" href="#">
64+
<Example code={`<a class="icon-link icon-link-hover" style="--bs-link-color: #198754;" href="#">
6565
Icon link
6666
<svg xmlns="http://www.w3.org/2000/svg" class="bi" viewBox="0 0 16 16" aria-hidden="true">
6767
<path d="M1 8a.5.5 0 0 1 .5-.5h11.793l-3.147-3.146a.5.5 0 0 1 .708-.708l4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 0 1-.708-.708L13.293 8.5H1.5A.5.5 0 0 1 1 8z"/>

0 commit comments

Comments
 (0)