|
1 | 1 | @use "@db-ui/base/build/scss/variables" as *;
|
| 2 | +@use "@db-ui/base/build/scss/scaling-placeholder" as *; |
| 3 | +@use "@db-ui/base/build/scss/color-placeholder" as *; |
2 | 4 | @use "@db-ui/base/build/scss/helpers/functions" as *;
|
3 | 5 | @use "@db-ui/base/build/scss/icon/icons.helpers" as *;
|
4 | 6 |
|
5 | 7 | @import "../../../css/partials.meta";
|
6 |
| -@import "link.variables"; |
7 | 8 |
|
8 | 9 | .elm-link {
|
9 |
| - border-radius: to-rem($pxValue: 4); |
| 10 | + color: var(--db-current-color, $db-colors-neutral-on-bg-enabled); |
10 | 11 | display: inline-block;
|
| 12 | + border-radius: to-rem($pxValue: 6); |
11 | 13 |
|
12 | 14 | // Link underline
|
13 |
| - text-underline-offset: to-rem($pxValue: 3); |
14 |
| - text-underline-position: under; |
15 |
| - @supports (text-underline-offset: 3px) { |
16 |
| - text-underline-position: auto; |
17 |
| - } |
| 15 | + text-underline-position: from-font; |
| 16 | + text-decoration-thickness: to-rem($pxValue: 1); |
| 17 | + |
| 18 | + // Changing color on hover should be animated by a transition |
| 19 | + transition: outline 0.06s, color $db-transition-color; |
18 | 20 |
|
19 |
| - &:active { |
20 |
| - color: initial; |
| 21 | + &:hover { |
| 22 | + color: inherit; |
21 | 23 | }
|
22 | 24 |
|
23 | 25 | // "disabled" links
|
24 | 26 | &[aria-disabled="true"] {
|
25 |
| - opacity: $link--disabled-opacity; |
| 27 | + opacity: var(--db-disabled-text-opacity, 0.5); |
26 | 28 |
|
27 | 29 | pointer-events: none;
|
28 | 30 |
|
|
31 | 33 | }
|
32 | 34 | }
|
33 | 35 |
|
34 |
| - // Sizes |
35 |
| - &%size-Small { |
36 |
| - &:not(.is-icon-text-replace) { |
37 |
| - font-size: to-rem($pxValue: 14); |
38 |
| - } |
39 |
| - |
40 |
| - &[rel], |
41 |
| - &[data-icon], |
42 |
| - &[data-icon-before] { |
43 |
| - @include icon-meta(20); |
44 |
| - } |
45 |
| - |
46 |
| - &[data-icon-after]::after { |
47 |
| - @include icon-meta($size: 20, $position: "after"); |
48 |
| - } |
| 36 | + &[data-content] { |
| 37 | + --icon-font-family: var(--db-base-icon-font-family); |
| 38 | + --icon-font-size: var(--db-base-icon-font-size); |
49 | 39 | }
|
50 | 40 |
|
51 |
| - &[data-size="small"] { |
52 |
| - @extend %size-Small; |
| 41 | + &[data-content="internal"] { |
| 42 | + @include icon(glyph(link), 24, "outline", "after"); |
53 | 43 | }
|
54 | 44 |
|
55 |
| - // Define the available icons |
56 |
| - &[rel="configuration"] { |
57 |
| - @include icon(glyph(settings), 24, "outline", $partial: $partial); |
| 45 | + &[data-content="external"] { |
| 46 | + @include icon(glyph(link-external), 24, "outline", "after"); |
58 | 47 | }
|
59 | 48 |
|
60 |
| - &[rel="messages"] { |
61 |
| - @include icon(glyph(chat), 24, "outline", $partial: $partial); |
| 49 | + &[data-content="internal"], |
| 50 | + &[data-content="external"] { |
| 51 | + &::after { |
| 52 | + --icon-margin-before: var(--db-spacing-fixed-2xs); |
| 53 | + margin-top: -3px; |
| 54 | + } |
| 55 | + |
| 56 | + &:focus-visible { |
| 57 | + outline-offset: var(--db-focus-outline-offset, 1px); |
| 58 | + } |
62 | 59 | }
|
63 | 60 |
|
64 |
| - &[rel="account"] { |
65 |
| - @include icon(glyph(account), 24, "outline", $partial: $partial); |
| 61 | + &[data-variant="primary"] { |
| 62 | + @extend %db-primary-text-ia; |
66 | 63 | }
|
67 | 64 |
|
68 |
| - &[rel="configuration"], |
69 |
| - &[rel="messages"], |
70 |
| - &[rel="account"] { |
71 |
| - &::before { |
72 |
| - // preventing an underlined icon on click |
73 |
| - display: inline-block; |
| 65 | + // data-size=small is defined by tonality in "@db-ui/base/build/scss/tonality" |
| 66 | + &[data-size="small"] { |
| 67 | + &[data-content="internal"], |
| 68 | + &[data-content="external"] { |
| 69 | + &::after { |
| 70 | + --icon-margin-before: var(--db-spacing-fixed-3xs); |
| 71 | + } |
74 | 72 | }
|
75 | 73 | }
|
76 | 74 | }
|
0 commit comments