Skip to content

Commit fd63c77

Browse files
committed
Fix the overflow problem for the link tooltips
1 parent f7e3d1e commit fd63c77

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

src/styles/global.css

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ body {
8585

8686
.tooltip .tooltip-text {
8787
visibility: hidden;
88-
width: 200px;
88+
width: 120px;
8989
background-color: #1e1e2e;
9090
color: #cdd6f4;
9191
text-align: center;
@@ -95,14 +95,16 @@ body {
9595
z-index: 1000;
9696
top: 125%;
9797
left: 50%;
98-
margin-left: -100px;
98+
transform: translateX(-50%);
9999
opacity: 0;
100100
transition: opacity 0.2s ease-in-out;
101101
font-size: 0.85rem;
102102
font-weight: 500;
103103
border: 1px solid #89b4fa;
104104
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
105105
pointer-events: none;
106+
white-space: nowrap;
107+
overflow: visible;
106108
}
107109

108110
.tooltip .tooltip-text::after {
@@ -155,8 +157,10 @@ body {
155157
}
156158

157159
.tooltip .tooltip-text {
158-
width: 160px;
159-
margin-left: -80px;
160+
width: auto;
161+
min-width: 80px;
162+
max-width: 160px;
163+
transform: translateX(-50%);
160164
font-size: 0.8rem;
161165
}
162166
}
@@ -182,8 +186,10 @@ body {
182186
}
183187

184188
.tooltip .tooltip-text {
185-
width: 140px;
186-
margin-left: -70px;
189+
width: auto;
190+
min-width: 70px;
191+
max-width: 140px;
192+
transform: translateX(-50%);
187193
font-size: 0.75rem;
188194
padding: 6px 10px;
189195
}

src/styles/hero.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,16 @@
102102

103103
.social-links .tooltip {
104104
display: inline-block;
105+
position: relative;
106+
}
107+
108+
.social-links .tooltip .tooltip-text {
109+
width: auto;
110+
min-width: 80px;
111+
max-width: 120px;
112+
left: 50%;
113+
transform: translateX(-50%);
114+
white-space: nowrap;
105115
}
106116

107117
.social-links a {

0 commit comments

Comments
 (0)