11.tooltip-wrapper {
2- position : relative ;
3-
4- a .tooltip-target {
5- text-decoration : underline dotted ;
2+ position : relative ;
3+
4+ a .tooltip-target :has (+ .tooltip ) {
5+ text-decoration : underline dotted ;
6+ }
7+
8+ .tooltip {
9+ visibility : hidden ;
10+
11+ display : flex ;
12+ position : absolute ;
13+ z-index : var (--site-z-floating );
14+ top : 100% ;
15+ left : 50% ;
16+ transform : translateX (-50% );
17+
18+ flex-flow : column nowrap ;
19+ width : 20rem ;
20+
21+ background : var (--site-raised-bgColor );
22+ border : 0.05rem solid rgba (0 , 0 , 0 , .125 );
23+ border-radius : 0.75rem ;
24+ box-shadow : 0 0.5rem 1rem rgba (0 , 0 , 0 , .15 );
25+ padding : 0.8rem ;
26+
27+ font-size : 1rem ;
28+ font-weight : normal ;
29+ font-style : normal ;
30+
31+ .tooltip-header {
32+ font-size : 1.2rem ;
33+ font-weight : 500 ;
34+ margin-bottom : 0.25rem ;
635 }
736
8- .tooltip {
9- visibility : hidden ;
10-
11- display : flex ;
12- position : absolute ;
13- z-index : 100 ;
14- top : 100% ;
15- left : 50% ;
16- transform : translateX (-50% );
17-
18- flex-flow : column nowrap ;
19- width : 20rem ;
20-
21- background : var (--site-raised-bgColor );
22- border : 0.05rem solid rgba (0 , 0 , 0 , .125 );
23- border-radius : 0.75rem ;
24- box-shadow : 0 0.5rem 1rem rgba (0 , 0 , 0 , .15 );
25- padding : 0.8rem ;
26-
27- .tooltip-header {
28- font-size : 1.2rem ;
29- font-weight : 500 ;
30- margin-bottom : 0.25rem ;
31- }
32-
33- .tooltip-content {
34- font-size : 0.875rem ;
35- color : var (--site-secondary-textColor );
36- }
37+ .tooltip-content {
38+ font-size : 0.875rem ;
39+ color : var (--site-secondary-textColor );
3740 }
41+ }
3842
39- // On non-touch devices, show tooltip on hover or focus.
40- @media all and not (pointer : coarse) {
41- & :hover .tooltip {
42- visibility : visible ;
43- }
43+ // On non-touch devices, show tooltip on hover or focus.
44+ @media all and not (pointer : coarse) {
45+ & :hover .tooltip {
46+ visibility : visible ;
47+ }
4448
45- & :has (.tooltip-target :focus ) .tooltip {
46- visibility : visible ;
47- }
49+ & :focus-within .tooltip {
50+ visibility : visible ;
4851 }
52+ }
4953
50- // On touch devices, show tooltip on click.
51- @media all and (pointer : coarse) {
52- .tooltip.visible {
53- visibility : visible ;
54- }
54+ // On touch devices, show tooltip on click.
55+ @media all and (pointer : coarse) {
56+ .tooltip.visible {
57+ visibility : visible ;
5558 }
59+ }
5660
5761}
0 commit comments