fix(editor): fold ranges, stacked replace bar and container scrolling
This commit is contained in:
@@ -1,15 +1,20 @@
|
||||
:root { color-scheme: light dark; --chrome-top: 10px; --content-scale: 1; }
|
||||
/* Reserve scrollbar space permanently so the fixed toolbar doesn't shift
|
||||
between modes (one with scrollbar, one without). */
|
||||
html { overflow-y: scroll; scrollbar-gutter: stable; }
|
||||
/* The document scrolls inside #app, below the tab strip. Preview and edit mode
|
||||
therefore show the same scrollbar position and size. */
|
||||
html { overflow: hidden; }
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
|
||||
margin: 0; padding: 0;
|
||||
line-height: 1.6; font-size: 15px;
|
||||
color: #1a1a1a; background: #fff;
|
||||
height: 100vh; display: flex; flex-direction: column; overflow: hidden;
|
||||
}
|
||||
body.has-tabs { --chrome-top: 50px; }
|
||||
#app { width: 100%; box-sizing: border-box; margin: 0 auto; padding: 24px 48px; }
|
||||
#app { flex: 1 1 auto; min-height: 0; width: 100%; box-sizing: border-box; margin: 0 auto; padding: 24px 48px; overflow-y: auto; overflow-x: hidden; scrollbar-gutter: stable; }
|
||||
#app::-webkit-scrollbar { width: 10px; }
|
||||
#app::-webkit-scrollbar-track { background: transparent; }
|
||||
#app::-webkit-scrollbar-thumb { background: rgba(128,128,128,.45); border-radius: 6px; }
|
||||
#app::-webkit-scrollbar-thumb:hover { background: rgba(128,128,128,.65); }
|
||||
#preview { font-size: calc(15px * var(--content-scale)); }
|
||||
#preview .front-matter {
|
||||
margin: 0 0 1.5em;
|
||||
@@ -163,7 +168,7 @@ body.has-tabs { --chrome-top: 50px; }
|
||||
.recent-name { color: #555; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.recent-path { color: #aaa; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.tabbar {
|
||||
display: none; position: sticky; top: 0; z-index: 110; height: 40px;
|
||||
display: none; flex: none; position: sticky; top: 0; z-index: 110; height: 40px;
|
||||
box-sizing: border-box; align-items: stretch; gap: 4px; padding: 4px 8px;
|
||||
border-bottom: 1px solid #e6e6e6; background: rgba(248,248,248,0.96);
|
||||
backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
|
||||
@@ -430,14 +435,29 @@ body.editing.cm-active #cm-editor { display: block; height: 100%; padding: 10px
|
||||
|
||||
@media print {
|
||||
#cm-editor { display: none !important; }
|
||||
html, body { height: auto !important; overflow: visible !important; display: block !important; }
|
||||
#app { flex: none !important; height: auto !important; min-height: 0 !important; overflow: visible !important; scrollbar-gutter: auto; }
|
||||
}
|
||||
|
||||
/* Edit-mode find/replace bar: same look as the preview findbar. */
|
||||
html.cm-editing { overflow: hidden; scrollbar-gutter: auto; }
|
||||
#edit-findbar { top: calc(var(--chrome-top) + 8px); z-index: 130; }
|
||||
#edit-findbar { top: calc(var(--chrome-top) + 8px); z-index: 130; flex-wrap: wrap; }
|
||||
body.edit-finding #edit-findbar { display: flex; }
|
||||
#edit-findbar .edit-replace-group { display: flex; align-items: center; gap: 6px; }
|
||||
#edit-findbar .edit-replace-group { display: flex; flex: 1 0 100%; align-items: center; gap: 6px; justify-content: flex-start; border-top: 1px solid rgba(0,0,0,.08); padding-top: 6px; margin-top: 2px; }
|
||||
#edit-findbar .edit-replace-group[hidden] { display: none; }
|
||||
#edit-findbar #edit-replace-input { width: 160px; }
|
||||
#edit-findbar button.edit-replace-btn { width: auto; min-width: 54px; padding: 0 8px; font-size: 12px; }
|
||||
#cm-editor .cm-edit-find-hit { background: rgba(255, 213, 0, .38); }
|
||||
|
||||
/* Use the same thin scrollbar inside CodeMirror as the preview container. */
|
||||
#cm-editor .CodeMirror-vscrollbar::-webkit-scrollbar { width: 10px; }
|
||||
#cm-editor .CodeMirror-vscrollbar::-webkit-scrollbar-track { background: transparent; }
|
||||
#cm-editor .CodeMirror-vscrollbar::-webkit-scrollbar-thumb { background: rgba(128,128,128,.45); border-radius: 6px; }
|
||||
#cm-editor .CodeMirror-vscrollbar::-webkit-scrollbar-thumb:hover { background: rgba(128,128,128,.65); }
|
||||
@media (prefers-color-scheme: dark) {
|
||||
#app::-webkit-scrollbar-thumb { background: rgba(200,200,200,.35); }
|
||||
#app::-webkit-scrollbar-thumb:hover { background: rgba(200,200,200,.55); }
|
||||
#cm-editor .CodeMirror-vscrollbar::-webkit-scrollbar-thumb { background: rgba(200,200,200,.35); }
|
||||
#cm-editor .CodeMirror-vscrollbar::-webkit-scrollbar-thumb:hover { background: rgba(200,200,200,.55); }
|
||||
#edit-findbar .edit-replace-group { border-top-color: rgba(255,255,255,.12); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user