Skip to content

Commit 20cd464

Browse files
committed
style(toc): update drag handle positioning and appearance
1 parent 69b4791 commit 20cd464

1 file changed

Lines changed: 41 additions & 17 deletions

File tree

packages/webapp/src/styles/components/_tableOfContents.scss

Lines changed: 41 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@
209209
.toc__item {
210210
.btnFold {
211211
position: absolute;
212-
left: 6px;
212+
left: 12px;
213213
top: 50%;
214214
transform: translateY(-50%);
215215
display: flex;
@@ -256,46 +256,70 @@
256256
// ======================
257257
.toc-drag-handle {
258258
position: absolute;
259-
left: -8px;
259+
left: 6px;
260260
top: 50%;
261-
transform: translateY(-50%) translateX(4px);
261+
transform: translateY(-50%) translateX(-8px) scale(0.85);
262262
display: flex;
263263
align-items: center;
264264
justify-content: center;
265-
width: 20px;
266-
height: 20px;
265+
width: 16px;
266+
height: 18px;
267267
opacity: 0;
268268
cursor: grab;
269-
color: #9ca3af;
270-
transition: all 0.15s ease;
271-
border-radius: 4px;
272-
z-index: 2;
269+
color: #a1a1aa;
270+
background: linear-gradient(to bottom, #fafafa, #f4f4f5);
271+
border: 1px solid rgba(0, 0, 0, 0.06);
272+
border-radius: 3px;
273+
box-shadow:
274+
0 1px 2px rgba(0, 0, 0, 0.04),
275+
inset 0 1px 0 rgba(255, 255, 255, 0.8);
276+
transition:
277+
opacity 0.18s ease-out,
278+
transform 0.18s ease-out,
279+
color 0.12s ease,
280+
background 0.12s ease,
281+
border-color 0.12s ease,
282+
box-shadow 0.12s ease;
283+
z-index: 10;
273284

274285
&:hover {
275-
color: #6b7280;
276-
background-color: #f3f4f6;
286+
color: #71717a;
287+
background: linear-gradient(to bottom, #f4f4f5, #e4e4e7);
288+
border-color: rgba(0, 0, 0, 0.1);
289+
box-shadow:
290+
0 2px 4px rgba(0, 0, 0, 0.08),
291+
inset 0 1px 0 rgba(255, 255, 255, 0.6);
292+
transform: translateY(-50%) translateX(-10px) scale(1.08);
277293
}
278294

279295
&:active {
280296
cursor: grabbing;
297+
color: var(--color-docsy);
298+
background: linear-gradient(to bottom, #e4e4e7, #d4d4d8);
299+
border-color: color-mix(in srgb, var(--color-docsy) 30%, transparent);
300+
box-shadow:
301+
0 1px 1px rgba(0, 0, 0, 0.06),
302+
inset 0 1px 2px rgba(0, 0, 0, 0.08);
303+
transform: translateY(-50%) translateX(-10px) scale(0.95);
304+
transition-duration: 0.05s;
281305
}
282306
}
283307

284-
// Show drag handle on hover
308+
// Fade + slide in on item hover
285309
.toc__item:hover > a > .toc-drag-handle {
286310
opacity: 0.7;
287-
transform: translateY(-50%) translateX(0);
311+
transform: translateY(-50%) translateX(-10px) scale(1.18);
288312
}
289313

290-
// Increase opacity on direct hover
291-
.toc__item > a:hover > .toc-drag-handle {
314+
// Full visibility on direct hover
315+
.toc__item > a:hover > .toc-drag-handle,
316+
.toc-drag-handle:hover {
292317
opacity: 1;
293-
transform: translateY(-50%) translateX(-2px);
294318
}
295319

296320
// Links with drag handle need extra left padding
297321
.toc__item > a.has-drag-handle {
298-
padding-left: 32px !important;
322+
padding-left: 36px !important;
299323
}
300324

301325
// Ghosted state for items during drag

0 commit comments

Comments
 (0)