Add tab reordering, sidebar resize and collapse, and outline panel
- Drag tabs to reorder; context menu to close, close others, close right - Resizable sidebar width (synced setting), collapsible with Mod+\ - Outline panel (Mod+Shift+O): right column on desktop, overlay on mobile - Mobile: title opens quick switcher, swipe left closes the drawer, 44px touch targets
This commit is contained in:
1 parent
91da6e116e
commit
64915a7b94
7 files changed
+322
-15
No files matched your search
+35
-6
@@ -106,12 +106,26 @@ button {
|
||||
/* ---- 布局 ---- */
|
||||
.rm-shell { display: flex; height: 100%; }
|
||||
.rm-sidebar {
|
||||
position: relative;
|
||||
width: var(--rm-sidebar-width);
|
||||
flex: none;
|
||||
background: var(--rm-sidebar-bg);
|
||||
border-right: 1px solid var(--rm-divider);
|
||||
}
|
||||
.rm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
|
||||
.rm-sidebar-resize { position: absolute; top: 0; right: -3px; bottom: 0; width: 6px; cursor: col-resize; z-index: 5; touch-action: none; }
|
||||
.rm-sidebar-resize:hover,
|
||||
.rm-sidebar-resize:active { background: var(--rm-accent); opacity: 0.4; }
|
||||
.sidebar-collapsed .rm-sidebar { display: none; }
|
||||
|
||||
/* ---- 大纲 ---- */
|
||||
.rm-outline-backdrop { display: contents; }
|
||||
.rm-outline { flex: none; width: 240px; display: flex; flex-direction: column; border-left: 1px solid var(--rm-divider); background: var(--rm-sidebar-bg); }
|
||||
.rm-outline-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 8px 6px 16px; font-size: 13px; font-weight: 600; color: var(--rm-text-muted); }
|
||||
.rm-outline-list { flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: 0 6px 12px; }
|
||||
.rm-outline-list li { padding-top: 5px; padding-bottom: 5px; padding-right: 8px; border-radius: 6px; font-size: 13px; line-height: 1.4; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.rm-outline-list li:hover { background: var(--rm-hover); }
|
||||
.rm-outline-list li.on { color: var(--rm-accent-strong); background: var(--rm-active); }
|
||||
.rm-backdrop,
|
||||
.rm-mobile-bar { display: none; }
|
||||
|
||||
@@ -284,7 +298,15 @@ button {
|
||||
scrollbar-width: none;
|
||||
flex: none;
|
||||
}
|
||||
.rm-tabs:empty { display: none; }
|
||||
.rm-tabs.empty { display: none; }
|
||||
.rm-tabs-side,
|
||||
.rm-tabs-outline { flex: none; align-self: center; margin-bottom: 4px; }
|
||||
.rm-tabs-outline { margin-left: auto; position: sticky; right: 0; background: var(--rm-bg); }
|
||||
.rm-tabs-outline.on { color: var(--rm-accent-strong); }
|
||||
.rm-tab.dragging { opacity: 0.5; }
|
||||
.rm-tab.drop-before { box-shadow: inset 2px 0 0 var(--rm-accent); }
|
||||
.rm-tab.drop-after { box-shadow: inset -2px 0 0 var(--rm-accent); }
|
||||
.rm-tab-menu { position: fixed; z-index: 20; min-width: 160px; }
|
||||
.rm-tab {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -479,13 +501,20 @@ button {
|
||||
border-bottom: 1px solid var(--rm-divider);
|
||||
flex: none;
|
||||
}
|
||||
.rm-mobile-bar .rm-icon-btn { width: 40px; height: 40px; }
|
||||
.rm-mobile-title { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.rm-mobile-bar .rm-icon-btn { width: 44px; height: 44px; }
|
||||
.rm-mobile-title { flex: 1; min-width: 0; height: 40px; padding: 0 4px; border: 0; background: none; color: var(--rm-text); font: inherit; font-weight: 600; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.sidebar-collapsed .rm-sidebar { display: block; }
|
||||
.rm-sidebar-resize { display: none; }
|
||||
/* 大纲在手机上为从右侧滑入的浮层 */
|
||||
.rm-outline-backdrop { display: block; position: fixed; inset: 0; z-index: 41; background: rgba(0, 0, 0, 0.3); }
|
||||
.rm-outline { position: absolute; top: 0; right: 0; bottom: 0; width: min(80vw, 300px); padding-top: env(safe-area-inset-top); box-shadow: var(--rm-shadow); }
|
||||
.rm-outline-list li { padding-top: 12px; padding-bottom: 12px; font-size: 15px; }
|
||||
.rm-save-state { width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: transparent; }
|
||||
.rm-save-state.on { background: var(--rm-accent); }
|
||||
.rm-tree-row { height: 40px; font-size: 15px; }
|
||||
.rm-tree-more { opacity: 1; width: 36px; height: 36px; }
|
||||
.rm-sidebar-head .rm-icon-btn { width: 40px; height: 40px; }
|
||||
/* 触控热区不小于 44px */
|
||||
.rm-tree-row { height: 44px; font-size: 15px; }
|
||||
.rm-tree-more { opacity: 1; width: 44px; height: 44px; }
|
||||
.rm-sidebar-head .rm-icon-btn { width: 44px; height: 44px; }
|
||||
/* 小于 16px 时 iOS Safari 聚焦输入框会自动放大页面 */
|
||||
.rm-search-input { height: 40px; font-size: 16px; }
|
||||
.rm-auth-card input,
|
||||
|
||||
Reference in new issue
Block a user