Skip to content

Commit 5cd306d

Browse files
committed
Fix tooltip positioning to appear below headers
- Change tooltip position from above to below (top instead of bottom) - Add overflow-y visible to prevent clipping by table container - Increase padding and add shadow for better visibility
1 parent 34572c7 commit 5cd306d

1 file changed

Lines changed: 16 additions & 5 deletions

File tree

site/index.html

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,22 @@
3333
.tooltip::after {
3434
content: attr(data-tooltip);
3535
position: absolute;
36-
z-index: 50;
36+
z-index: 9999;
3737
visibility: hidden;
3838
opacity: 0;
3939
transition: opacity 0.2s ease-in-out;
4040
background-color: #18181b;
4141
color: #fff;
4242
font-size: 0.75rem;
4343
font-weight: 400;
44-
padding: 0.25rem 0.5rem;
45-
border-radius: 0.25rem;
44+
padding: 0.5rem 0.75rem;
45+
border-radius: 0.375rem;
4646
white-space: nowrap;
47-
bottom: 100%;
47+
top: calc(100% + 0.5rem);
4848
left: 50%;
4949
transform: translateX(-50%);
50-
margin-bottom: 0.5rem;
5150
pointer-events: none;
51+
box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
5252
}
5353
.dark .tooltip::after {
5454
background-color: #f4f4f5;
@@ -58,6 +58,17 @@
5858
visibility: visible;
5959
opacity: 1;
6060
}
61+
/* Allow tooltips to overflow table container */
62+
thead {
63+
overflow: visible !important;
64+
}
65+
thead th {
66+
overflow: visible !important;
67+
}
68+
/* The table wrapper needs overflow-y visible for tooltips above */
69+
.overflow-x-auto {
70+
overflow-y: visible !important;
71+
}
6172
</style>
6273
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
6374
<script src="config.js"></script>

0 commit comments

Comments
 (0)