Files
openidea/src/ui/Splitter.module.css
T
DrPepperandmakise2060 e09cb2353f fix(workbench): keep the resize cursor while dragging a splitter (#2560)
A resize drag set document.body.style.cursor, so as soon as the pointer left the 1px handle the element under it (tree, editor, button) showed its own cursor mid-drag. The drag now holds the cursor on <html> with a data-drag-cursor rule that overrides descendant cursors, released on pointerup/pointercancel/window blur, with nested locks restoring the outer cursor. Tool-window gaps, split and stripe handles, the dialog resize grip and database / Git Log column resizing share it, and the handles use ew-resize / ns-resize throughout.

Co-authored-by: makise2060 <263516586+makise2060@users.noreply.github.com>
2026-11-11 00:06:59 +08:00

72 lines
1.4 KiB
CSS

.group {
min-width: 0;
min-height: 0;
}
.panel {
display: flex;
flex-direction: column;
min-width: 0;
min-height: 0;
height: 100%;
}
.handle {
position: relative;
flex: none;
background: var(--border);
outline: none;
transition: background var(--dur) var(--ease);
}
.handle[aria-orientation="vertical"] {
width: 1px;
cursor: ew-resize;
}
.handle[aria-orientation="horizontal"] {
height: 1px;
cursor: ns-resize;
}
.handle::after {
content: "";
position: absolute;
z-index: var(--z-panel);
}
.handle[aria-orientation="vertical"]::after {
inset: 0 -3px;
}
.handle[aria-orientation="horizontal"]::after {
inset: -3px 0;
}
.handle[data-separator="hover"],
.handle:focus-visible {
background: var(--border-strong);
}
.handle[data-separator="active"] {
background: var(--border-strong);
}
.handle[data-separator="disabled"] {
cursor: default;
}
.invisible,
.invisible[data-separator] {
background: none;
}
.invisible[aria-orientation="vertical"] {
width: 0;
}
.invisible[aria-orientation="horizontal"] {
height: 0;
}
/* Islands gaps: nothing is drawn while dragging; keyboard focus still shows. */
.invisible:focus-visible::after {
background: color-mix(in srgb, var(--focus-ring) 55%, transparent);
}
.handle[data-separator="disabled"]::after {
display: none;
}
@media (prefers-reduced-motion: reduce) {
.handle {
transition: none;
}
}