Skip to content

Commit a3cad95

Browse files
committed
apply review
1 parent 0a14702 commit a3cad95

File tree

3 files changed

+56
-48
lines changed

3 files changed

+56
-48
lines changed
Lines changed: 50 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,61 @@
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
}

site/lib/src/components/common/client/api_link_tooltip.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ class _InteractiveApiLinkState extends State<ApiLinkTooltip> {
4646
component.url,
4747
);
4848

49+
if (extractedHeader == null && extractedDescription == null) {
50+
return;
51+
}
52+
4953
if (!mounted) return;
5054
setState(() {
5155
tooltipContent = fragment([
@@ -131,7 +135,7 @@ class _InteractiveApiLinkState extends State<ApiLinkTooltip> {
131135
href: component.url,
132136
classes: 'tooltip-target',
133137
events: {
134-
if (isTouchscreen)
138+
if (tooltipContent != null && isTouchscreen)
135139
'click': (event) {
136140
if (!isVisible) {
137141
setState(() => isVisible = true);

site/lib/src/style_hash.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
// dart format off
33

44
/// The generated hash of the `main.css` file.
5-
const generatedStylesHash = 'XbLzy+N6PeGl';
5+
const generatedStylesHash = 'ukol6oECbi3R';

0 commit comments

Comments
 (0)