From 94af42a8bc249645dbb6b60599ac12e10d0d8d22 Mon Sep 17 00:00:00 2001 From: Erzbir Date: Sat, 16 May 2026 15:52:23 +0800 Subject: [PATCH] feat: support fullscreen layout --- settings.yaml | 8 +++++++- src/styles/main.scss | 20 +++++++++++++++++++- src/styles/toc.scss | 6 ++++++ templates/modules/layout.html | 2 +- 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/settings.yaml b/settings.yaml index 0e87302..2c3cffa 100644 --- a/settings.yaml +++ b/settings.yaml @@ -39,6 +39,12 @@ spec: value: help: 填写的值为 max-width 属性的值 + - $formkit: checkbox + label: 启用全屏布局 + name: fullscreen_layout + value: false + help: 开启后隐藏左右侧边栏并让正文区域占满可用宽度 + - $formkit: checkbox label: 使用系统字体 name: system_font_enable @@ -330,4 +336,4 @@ spec: - $formkit: text name: filing_link label: 公安备案跳转链接 - value: https://www.beian.gov.cn/ \ No newline at end of file + value: https://www.beian.gov.cn/ diff --git a/src/styles/main.scss b/src/styles/main.scss index 7e09ee8..5ec34fe 100644 --- a/src/styles/main.scss +++ b/src/styles/main.scss @@ -99,6 +99,24 @@ body { flex-direction: column; } +body[layout_mode='fullscreen'] { + .wrapper { + display: block; + } + + .sidebar-left, + .sidebar-right { + display: none; + width: 0; + padding: 0; + } + + .container { + width: 100%; + max-width: none !important; + } +} + @media (max-width: 1024px) { .sidebar-left, .sidebar-right { @@ -557,4 +575,4 @@ blockquote.twitter-tweet::before { iframe[src*="youtube.com"] { border: calc(var(--width-theme-border) * 2) var(--style-theme-border) var(--color-theme-accent) !important; padding: calc(var(--size-theme-font) * 0.5) !important; -} \ No newline at end of file +} diff --git a/src/styles/toc.scss b/src/styles/toc.scss index 4aa0940..8882e24 100644 --- a/src/styles/toc.scss +++ b/src/styles/toc.scss @@ -113,6 +113,12 @@ } } +body[layout_mode='fullscreen'] { + .toc.toc-visible { + border: calc(var(--size-theme-font) * 0.0625) solid var(--color-theme-foreground); + } +} + @media (max-width: 1400px) { .toc.toc-visible { border: calc(var(--size-theme-font) * 0.0625) solid var(--color-theme-foreground); diff --git a/templates/modules/layout.html b/templates/modules/layout.html index 92b4e13..3af6292 100644 --- a/templates/modules/layout.html +++ b/templates/modules/layout.html @@ -144,7 +144,7 @@ - +