From 92daaecd681d3b6208ce55610c5f382e9026e355 Mon Sep 17 00:00:00 2001 From: Yang Jun Date: Mon, 22 Jun 2026 20:46:08 +0800 Subject: [PATCH] refactor(docs): drop playground window chrome from capture demo Co-authored-by: Cursor --- docs/themes/navy/layout/playground.swig | 20 ++- .../navy/source/css/_partial/playground.styl | 114 +++++++----------- docs/themes/navy/source/css/_variables.styl | 17 --- docs/themes/navy/source/js/main.js | 9 +- 4 files changed, 52 insertions(+), 108 deletions(-) diff --git a/docs/themes/navy/layout/playground.swig b/docs/themes/navy/layout/playground.swig index 061c42905..1897d2f5d 100644 --- a/docs/themes/navy/layout/playground.swig +++ b/docs/themes/navy/layout/playground.swig @@ -4,23 +4,17 @@
-
- Template -
{{ raw('partial/demo.liquid') }}
-
+

Template

+
{{ raw('partial/demo.liquid') }}
-
- Context -
{{ raw('partial/demo.json') }}
-
+

Context

+
{{ raw('partial/demo.json') }}
-
- Output -
-
{{__('playground.loading')}}
-
+

Output

+
+
{{__('playground.loading')}}
diff --git a/docs/themes/navy/source/css/_partial/playground.styl b/docs/themes/navy/source/css/_partial/playground.styl index f1230bc1c..52037c6ff 100644 --- a/docs/themes/navy/source/css/_partial/playground.styl +++ b/docs/themes/navy/source/css/_partial/playground.styl @@ -13,6 +13,14 @@ margin-bottom: 24px color: var(--color-default) + h2 + font-size: 0.8125rem + font-weight: 600 + text-transform: uppercase + letter-spacing: 0.04em + color: var(--color-gray) + margin: 0 + #editors display: grid overflow: hidden @@ -48,80 +56,46 @@ .editor-wrapper display: flex + gap: 8px flex-direction: column min-height: 0 overflow: hidden - - .pane-window - flex: 1 1 auto - min-height: 0 - position: relative - display: flex - flex-direction: column - playground-window-chrome() - overflow: hidden - @media mq-mobile - min-height: 240px - - .pane-tab - position: absolute - z-index: 5 - top: 0 - left: 0 - right: 0 - height: 36px - line-height: 36px - text-align: center - font-size: 0.75rem - font-weight: 600 - letter-spacing: 0.02em - color: var(--color-gray) - pointer-events: none - user-select: none - - .editor - flex: 1 1 auto - min-height: 0 - position: relative - overflow: hidden + .editor + flex: 1 1 auto + min-height: 0 + position: relative + code-block-chrome() + overflow: hidden + @media mq-mobile + min-height: 240px + .output-preview + flex: 1 1 auto + min-height: 0 + code-block-chrome() + overflow: auto + cursor: default + pre.highlight + margin: 0 + min-height: 100% + padding: 16px + border: none + box-shadow: none + border-radius: 0 + background: var(--highlight-background) + code + display: block + font-size: 14px + line-height: 1.5 + background: transparent + padding: 0 + white-space: pre .ace_editor - top: 0 - bottom: 0 - height: auto !important - - .output-preview - flex: 1 1 auto - min-height: 0 - cursor: default - overflow: auto - pre.highlight - margin: 0 - min-height: 100% - padding: 16px - border: none - box-shadow: none - border-radius: 0 0 6px 6px - background: var(--highlight-background) - code - display: block - font-size: 14px - line-height: 1.5 - background: transparent - padding: 0 - white-space: pre - - .ace_editor - font-family: font-mono - font-size: 14px - line-height: 1.5 - border-radius: 6px - .ace_gutter - display: none !important - width: 0 !important - .ace_scroller - left: 0 !important - .ace_scrollbar - z-index: 2 + font-family: font-mono + font-size: 14px + line-height: 1.5 + border-radius: 6px + .ace_scrollbar + z-index: 2 .version font-size: 0.8125rem diff --git a/docs/themes/navy/source/css/_variables.styl b/docs/themes/navy/source/css/_variables.styl index 2ef2bc84e..cac6b94fe 100644 --- a/docs/themes/navy/source/css/_variables.styl +++ b/docs/themes/navy/source/css/_variables.styl @@ -102,20 +102,3 @@ code-block-chrome() border-radius: 6px border: 1px solid var(--code-border) box-shadow: var(--code-shadow) - -playground-window-chrome() - code-block-chrome() - padding-top: 36px - &:before - content: '' - position: absolute - z-index: 4 - top: 0 - left: 0 - right: 0 - height: 36px - background: var(--highlight-background) - border-bottom: 1px solid var(--code-border) - border-radius: 6px 6px 0 0 - pointer-events: none - background-image: radial-gradient(circle at 12px 18px, #ff5f57 5px, transparent 5px), radial-gradient(circle at 28px 18px, #febc2e 5px, transparent 5px), radial-gradient(circle at 44px 18px, #28c840 5px, transparent 5px) diff --git a/docs/themes/navy/source/js/main.js b/docs/themes/navy/source/js/main.js index 9988013b6..b9c5e2154 100644 --- a/docs/themes/navy/source/js/main.js +++ b/docs/themes/navy/source/js/main.js @@ -73,10 +73,7 @@ const editorsEl = document.querySelector('#editors'); editorsEl.classList.remove('hide'); editorsEl.setAttribute('aria-hide', false); - editors.forEach(function(ed) { - ed.clearSelection(); - ed.resize(); - }); + editors.forEach(function(ed) { ed.resize(); }); } function getEditorTheme() { @@ -96,15 +93,11 @@ fontFamily: '"Source Code Pro", ui-monospace, Monaco, Menlo, Consolas, monospace', fontSize: '14px', showPrintMargin: false, - showGutter: false, - highlightActiveLine: false, - highlightSelectedWord: false, tabSize: 2, useSoftTabs: true, scrollPastEnd: 0.25 }); editor.getSession().setMode('ace/mode/' + lang); - editor.renderer.setShowGutter(false); editor.renderer.setScrollMargin(8, 8, 0, 0); return editor; }