|
1 |
| -.ds-helptext__button { |
2 |
| - --dsc-helptext-color: var(--ds-color-neutral-text-default); |
3 |
| - --dsc-helptext-icon-color: var(--ds-color-accent-base-default); |
4 |
| - --dsc-helptext-icon-width: var(--ds-sizing-7); |
5 |
| - --dsc-helptext-icon-height: var(--ds-sizing-7); |
| 1 | +.ds-helptext { |
| 2 | + --dsc-helptext-icon-size: 65%; |
| 3 | + --dsc-helptext-icon-url: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 8 14'%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M4 11a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM4 0c2.2 0 4 1.66 4 3.7 0 .98-.42 1.9-1.17 2.6l-.6.54-.29.29c-.48.46-.87.93-.94 1.41V9.5H3v-.81c0-1.26.84-2.22 1.68-3L5.42 5C5.8 4.65 6 4.2 6 3.7 6 2.66 5.1 1.83 4 1.83c-1.06 0-1.92.75-2 1.7v.15H0C0 1.66 1.8 0 4 0Z' clip-rule='evenodd'/%3E%3C/svg%3E"); |
| 4 | + --dsc-helptext-size: var(--ds-sizing-7); |
6 | 5 |
|
7 |
| - background-color: transparent; |
8 |
| - border-radius: 50px; |
9 |
| - padding: 0 !important; |
10 |
| - cursor: pointer; |
11 |
| - display: flex; |
12 |
| - border: none; |
13 |
| - min-width: 0; |
14 |
| - min-height: 0; |
15 |
| -} |
| 6 | + @composes ds-focus from '../css/utilities.css'; |
16 | 7 |
|
17 |
| -@media print { |
18 |
| - .ds-helptext__button { |
19 |
| - display: none; |
| 8 | + border-radius: var(--ds-border-radius-full); |
| 9 | + border: 2px solid; |
| 10 | + height: var(--dsc-helptext-size); |
| 11 | + min-height: 0; |
| 12 | + min-width: 0; |
| 13 | + padding: 0; |
| 14 | + position: relative; |
| 15 | + width: var(--dsc-helptext-size); |
| 16 | + |
| 17 | + &::before { |
| 18 | + content: ''; |
| 19 | + border-radius: inherit; |
| 20 | + background: currentcolor; |
| 21 | + mask-composite: exclude; |
| 22 | + mask-image: var(--dsc-helptext-icon-url); |
| 23 | + mask-position: center; |
| 24 | + mask-repeat: no-repeat; |
| 25 | + mask-size: |
| 26 | + var(--dsc-helptext-icon-size) var(--dsc-helptext-icon-size), |
| 27 | + cover; |
| 28 | + scale: 1.1; /* Hide tiny half pixel rendeing bug */ |
| 29 | + width: 100%; |
| 30 | + height: 100%; |
20 | 31 | }
|
21 |
| -} |
22 |
| - |
23 |
| -.ds-helptext__icon--filled { |
24 |
| - display: none; |
25 |
| -} |
26 | 32 |
|
27 |
| -.ds-helptext__icon { |
28 |
| - color: var(--dsc-helptext-icon-color); |
29 |
| - width: var(--dsc-helptext-icon-width); |
30 |
| - height: var(--dsc-helptext-icon-height); |
31 |
| -} |
32 |
| - |
33 |
| -.ds-helptext__button:where(:hover, :focus, [data-state^='open']) > .ds-helptext__icon { |
34 |
| - display: none; |
35 |
| -} |
36 |
| - |
37 |
| -.ds-helptext__button:where(:hover, :focus, [data-state^='open']) > .ds-helptext__icon--filled { |
38 |
| - display: inline-block; |
39 |
| -} |
40 |
| - |
41 |
| -.ds-helptext__content { |
42 |
| - color: var(--dsc-helptext-color); |
43 |
| - width: fit-content; |
44 |
| - max-width: 700px; |
45 |
| -} |
| 33 | + &:has(+ :popover-open)::before { |
| 34 | + mask-image: var(--dsc-helptext-icon-url), linear-gradient(currentcolor, currentcolor); /* Cut icon out of currentcolor surface */ |
| 35 | + } |
46 | 36 |
|
47 |
| -.ds-helptext--sm .ds-helptext__icon { |
48 |
| - --dsc-helptext-icon-width: var(--ds-sizing-6); |
49 |
| - --dsc-helptext-icon-height: var(--ds-sizing-6); |
50 |
| -} |
| 37 | + &[data-size='sm'] { |
| 38 | + --dsc-helptext-size: var(--ds-sizing-6); |
| 39 | + } |
51 | 40 |
|
52 |
| -.ds-helptext--md .ds-helptext__icon { |
53 |
| - --dsc-helptext-icon-width: var(--ds-sizing-7); |
54 |
| - --dsc-helptext-icon-height: var(--ds-sizing-7); |
55 |
| -} |
| 41 | + &[data-size='lg'] { |
| 42 | + --dsc-helptext-size: var(--ds-sizing-8); |
| 43 | + } |
56 | 44 |
|
57 |
| -.ds-helptext--lg .ds-helptext__icon { |
58 |
| - --dsc-helptext-icon-width: var(--ds-sizing-8); |
59 |
| - --dsc-helptext-icon-height: var(--ds-sizing-8); |
| 45 | + @media print { |
| 46 | + display: none; |
| 47 | + } |
60 | 48 | }
|
0 commit comments