forked from vhaudiquet/rhema-together
feat(web): resize the file list in the Files pane
The split between the file browser and viewer was fixed. A separator now drags it, with a 140px minimum and a 55% cap, and the arrow keys, Home, and End do the same. The width survives a reload. When the pane stacks the list above the viewer, the separator turns horizontal and saves a separate height.
This commit is contained in:
1 parent
ca333509a2
commit
d4aac727ad
2 files changed
+264
-8
No files matched your search
@@ -1537,17 +1537,60 @@ body.pane-resizing * {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
display: grid;
|
||||
grid-template-columns: minmax(140px, 34%) 1fr;
|
||||
grid-template-columns: clamp(140px, var(--files-browser-width, 34%), 55%) var(--sp-2) minmax(0, 1fr);
|
||||
grid-template-rows: minmax(0, 1fr);
|
||||
}
|
||||
|
||||
.files-browser {
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
border-right: 1px solid var(--border);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.files-resizer {
|
||||
position: relative;
|
||||
cursor: col-resize;
|
||||
touch-action: none;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.files-resizer::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: calc(50% - 0.5px);
|
||||
width: 1px;
|
||||
background: var(--border);
|
||||
transition: background-color 120ms ease, width 120ms ease, left 120ms ease, height 120ms ease, top 120ms ease;
|
||||
}
|
||||
|
||||
.files-resizer:hover::before,
|
||||
.files-resizer:focus-visible::before,
|
||||
body.files-resizing-x .files-resizer::before {
|
||||
left: calc(50% - 1px);
|
||||
width: 2px;
|
||||
background: var(--accent);
|
||||
}
|
||||
|
||||
.files-resizer:focus-visible {
|
||||
outline: 2px solid var(--accent);
|
||||
outline-offset: -2px;
|
||||
}
|
||||
|
||||
body.files-resizing-x,
|
||||
body.files-resizing-x * {
|
||||
cursor: col-resize !important;
|
||||
user-select: none !important;
|
||||
}
|
||||
|
||||
body.files-resizing-y,
|
||||
body.files-resizing-y * {
|
||||
cursor: row-resize !important;
|
||||
user-select: none !important;
|
||||
}
|
||||
|
||||
.crumbs {
|
||||
flex: 0 0 auto;
|
||||
padding: var(--sp-2);
|
||||
@@ -2001,13 +2044,37 @@ body.pane-resizing * {
|
||||
|
||||
@container (max-width: 430px) {
|
||||
.files {
|
||||
grid-template-columns: 1fr;
|
||||
grid-template-rows: minmax(120px, 38%) 1fr;
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
grid-template-rows: clamp(120px, var(--files-browser-height, 38%), 60%) var(--sp-2) minmax(0, 1fr);
|
||||
}
|
||||
|
||||
.files-browser {
|
||||
border-right: 0;
|
||||
border-bottom: 1px solid var(--border);
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.files-resizer {
|
||||
cursor: row-resize;
|
||||
}
|
||||
|
||||
.files-resizer::before {
|
||||
top: calc(50% - 0.5px);
|
||||
bottom: auto;
|
||||
left: 0;
|
||||
right: 0;
|
||||
width: auto;
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
.files-resizer:hover::before,
|
||||
.files-resizer:focus-visible::before,
|
||||
body.files-resizing-y .files-resizer::before {
|
||||
top: calc(50% - 1px);
|
||||
left: 0;
|
||||
right: 0;
|
||||
width: auto;
|
||||
height: 2px;
|
||||
background: var(--accent);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user