Skip to content

Commit a970749

Browse files
committed
Enhance tooltip styling for better visibility
1 parent ef899b3 commit a970749

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

index.html

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
/* `balloon.min.css` used for tooltip styling */
3636
:root {
3737
--balloon-border-radius: 6px;
38-
--balloon-color: #24292e;
38+
/* use a slightly opaque background to mask underlying page text */
39+
--balloon-color: rgba(36,41,46,0.95);
3940
--balloon-text-color: #fff;
4041
--balloon-font-size: 13px;
4142
--balloon-move: 4px;
@@ -57,14 +58,21 @@
5758
font-style: normal;
5859
text-shadow: none;
5960
font-size: var(--balloon-font-size);
61+
/* solid background and slight blur to improve legibility over page content */
6062
background: var(--balloon-color);
6163
color: var(--balloon-text-color);
6264
border-radius: var(--balloon-border-radius);
6365
content: attr(aria-label);
64-
padding: 0.5em 1em;
66+
padding: 0.55em 0.9em;
6567
position: absolute;
68+
display: inline-block;
6669
white-space: nowrap;
67-
z-index: 10;
70+
z-index: 9999;
71+
box-shadow: 0 6px 18px rgba(0,0,0,0.35);
72+
-webkit-backdrop-filter: blur(3px);
73+
backdrop-filter: blur(3px);
74+
max-width: 90vw;
75+
overflow-wrap: break-word;
6876
}
6977
[aria-label][data-balloon-pos]:before {
7078
width: 0;
@@ -76,7 +84,7 @@
7684
transition: all 0.18s ease-out 0.18s;
7785
content: "";
7886
position: absolute;
79-
z-index: 10;
87+
z-index: 9999;
8088
}
8189
[aria-label][data-balloon-pos]:hover:before,
8290
[aria-label][data-balloon-pos]:hover:after,

0 commit comments

Comments
 (0)