From 55be844f6134608cb6a430f3499b48c22c83f4c1 Mon Sep 17 00:00:00 2001 From: "Jiaxiao (mossaka) Zhou" Date: Tue, 17 Feb 2026 07:11:08 +0000 Subject: [PATCH 1/2] chore: clean up standalone editor HTML (10% reduction) Co-Authored-By: Claude Opus 4.6 (1M context) --- docs/public/editor/index.html | 279 +++++++++------------------------- 1 file changed, 75 insertions(+), 204 deletions(-) diff --git a/docs/public/editor/index.html b/docs/public/editor/index.html index 7b167199e3d..8db787b9544 100644 --- a/docs/public/editor/index.html +++ b/docs/public/editor/index.html @@ -9,7 +9,6 @@ CSS Custom Properties ============================================================ */ :root { - /* Light theme (default) */ --bg-primary: #ffffff; --bg-secondary: #f6f8fa; --bg-tertiary: #eaeef2; @@ -44,7 +43,6 @@ --success-text: #116329; --shadow-sm: 0 1px 2px rgba(27,31,36,0.04); - --shadow-md: 0 3px 6px rgba(140,149,159,0.15); --shadow-lg: 0 8px 24px rgba(140,149,159,0.2); --divider-color: #d1d9e0; @@ -67,8 +65,6 @@ --radius-sm: 6px; --radius-md: 8px; - --radius-lg: 12px; - --transition: 180ms ease; } @@ -107,7 +103,6 @@ --success-text: #3fb950; --shadow-sm: 0 1px 2px rgba(0,0,0,0.2); - --shadow-md: 0 3px 6px rgba(0,0,0,0.3); --shadow-lg: 0 8px 24px rgba(0,0,0,0.4); --divider-color: #30363d; @@ -141,6 +136,10 @@ } body { + display: flex; + flex-direction: column; + height: 100vh; + width: 100vw; font-family: var(--font-sans); background: var(--bg-primary); color: var(--text-primary); @@ -149,16 +148,6 @@ -moz-osx-font-smoothing: grayscale; } -/* ============================================================ - App Layout - ============================================================ */ -.app { - display: flex; - flex-direction: column; - height: 100vh; - width: 100vw; -} - /* ============================================================ Header ============================================================ */ @@ -187,9 +176,7 @@ text-decoration: none; } -.header-logo svg { - flex-shrink: 0; -} +.header-logo svg { flex-shrink: 0; } .header-separator { width: 1px; @@ -249,9 +236,7 @@ border-color: var(--border-primary); } -.btn-secondary:hover { - background: var(--bg-hover); -} +.btn-secondary:hover { background: var(--bg-hover); } .btn svg { width: 16px; @@ -272,7 +257,8 @@ transition: all var(--transition); } -.status-badge[data-status="loading"] { +.status-badge[data-status="loading"], +.status-badge[data-status="compiling"] { background: var(--accent-subtle); color: var(--accent); } @@ -282,11 +268,6 @@ color: var(--success-text); } -.status-badge[data-status="compiling"] { - background: var(--accent-subtle); - color: var(--accent); -} - .status-badge[data-status="error"] { background: var(--error-bg); color: var(--error-text); @@ -332,9 +313,7 @@ flex-shrink: 0; } -.toggle-track.active { - background: var(--toggle-bg-active); -} +.toggle-track.active { background: var(--toggle-bg-active); } .toggle-knob { position: absolute; @@ -348,9 +327,7 @@ box-shadow: 0 1px 3px rgba(0,0,0,0.2); } -.toggle-track.active .toggle-knob { - transform: translateX(14px); -} +.toggle-track.active .toggle-knob { transform: translateX(14px); } /* Theme toggle */ .theme-toggle { @@ -383,7 +360,7 @@ } /* ============================================================ - Error/Warning Banner + Banners (error/warning) ============================================================ */ .banner { display: none; @@ -396,9 +373,7 @@ transition: all var(--transition); } -.banner.visible { - display: flex; -} +.banner.visible { display: flex; } .banner-error { background: var(--error-bg); @@ -441,9 +416,7 @@ transition: opacity var(--transition); } -.banner-close:hover { - opacity: 1; -} +.banner-close:hover { opacity: 1; } /* ============================================================ Panels @@ -462,10 +435,7 @@ min-height: 0; } -.panel-editor { - flex: 1 1 50%; -} - +.panel-editor, .panel-output { flex: 1 1 50%; } @@ -474,6 +444,7 @@ display: flex; align-items: center; justify-content: space-between; + gap: 6px; padding: 8px 16px; font-size: 12px; font-weight: 600; @@ -487,13 +458,7 @@ transition: background var(--transition), color var(--transition), border-color var(--transition); } -.panel-header-label { - display: flex; - align-items: center; - gap: 6px; -} - -.panel-header-label svg { +.panel-header svg { width: 14px; height: 14px; opacity: 0.6; @@ -513,7 +478,6 @@ justify-content: center; } -/* Larger hit area for easier grabbing */ .divider::before { content: ''; position: absolute; @@ -523,7 +487,6 @@ bottom: 0; } -/* Grip dots */ .divider::after { content: ''; width: 3px; @@ -535,14 +498,10 @@ } .divider:hover::after, -.divider.dragging::after { - opacity: 0.5; -} +.divider.dragging::after { opacity: 0.5; } .divider:hover, -.divider.dragging { - background: var(--divider-hover); -} +.divider.dragging { background: var(--divider-hover); } /* ============================================================ Editor (left panel) @@ -602,27 +561,7 @@ transition: background var(--transition), color var(--transition); } -.editor-textarea::placeholder { - color: var(--text-muted); -} - -.editor-textarea::-webkit-scrollbar { - width: 8px; - height: 8px; -} - -.editor-textarea::-webkit-scrollbar-track { - background: var(--scrollbar-track); -} - -.editor-textarea::-webkit-scrollbar-thumb { - background: var(--scrollbar-thumb); - border-radius: 4px; -} - -.editor-textarea::-webkit-scrollbar-thumb:hover { - background: var(--scrollbar-thumb-hover); -} +.editor-textarea::placeholder { color: var(--text-muted); } /* ============================================================ Output (right panel) @@ -658,20 +597,25 @@ text-align: center; } +/* Scrollbars (shared) */ +.editor-textarea::-webkit-scrollbar, .output-container::-webkit-scrollbar { width: 8px; height: 8px; } +.editor-textarea::-webkit-scrollbar-track, .output-container::-webkit-scrollbar-track { background: var(--scrollbar-track); } +.editor-textarea::-webkit-scrollbar-thumb, .output-container::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 4px; } +.editor-textarea::-webkit-scrollbar-thumb:hover, .output-container::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); } @@ -725,7 +669,7 @@ } /* ============================================================ - Copy feedback + Copy feedback toast ============================================================ */ .copy-feedback { position: fixed; @@ -754,9 +698,7 @@ Responsive (<768px) ============================================================ */ @media (max-width: 767px) { - .panels { - flex-direction: column; - } + .panels { flex-direction: column; } .divider { width: 100%; @@ -764,11 +706,6 @@ cursor: row-resize; } - .panel-editor, - .panel-output { - flex: 1 1 50%; - } - .header { gap: 8px; padding: 0 12px; @@ -779,18 +716,11 @@ padding-bottom: 8px; } - .header-separator { - display: none; - } - - .auto-compile-label-text { - display: none; - } + .header-separator { display: none; } + .auto-compile-label-text { display: none; } } -/* ============================================================ - Keyboard hint - ============================================================ */ +/* Keyboard hint */ .kbd { display: inline-block; padding: 1px 5px; @@ -805,7 +735,6 @@ -
@@ -854,11 +783,9 @@
- +