feat: add content padding setting

This commit is contained in:
Erzbir
2026-06-15 22:23:34 +08:00
parent 99a04beb11
commit b7a5ce82ac
3 changed files with 17 additions and 2 deletions
+7
View File
@@ -65,6 +65,13 @@ spec:
placeholder: "1rem"
help: 控制全站基础字体大小, 例如 16px、1rem、18px, 留空使用主题默认值
- $formkit: text
label: 正文区域内边距
name: content_padding
value:
placeholder: "calc(var(--size-theme-font) * 2.5)"
help: 控制正文容器内边距, 例如 2rem、24px、calc(var(--size-theme-font) * 2), 留空使用主题默认值
- $formkit: checkbox
label: 使用系统字体
name: system_font_enable
+4 -2
View File
@@ -27,6 +27,8 @@
--width-theme-border: calc(var(--size-theme-font) * 0.125);
--width-theme-table-border: calc(var(--size-theme-font) * 0.0625);
--width-theme-media-max: 60%;
--spacing-theme-container-padding: calc(var(--size-theme-font) * 2.5);
--spacing-theme-container-padding-mobile: calc(var(--size-theme-font) * 1.25);
--style-theme-border: solid;
--style-theme-table-border: dashed;
--style-theme-title-divider: dashed;
@@ -90,7 +92,7 @@ body {
.container {
display: flex;
flex-direction: column;
padding: calc(var(--size-theme-font) * 2.5);
padding: var(--spacing-theme-container-padding);
width: 60%;
margin: 0 auto;
}
@@ -145,7 +147,7 @@ body[table_full_width='true'] {
@media (max-width: 768px) {
.container {
padding: calc(var(--size-theme-font) * 1.25);
padding: var(--spacing-theme-container-padding-mobile);
}
}
+6
View File
@@ -147,6 +147,12 @@
--size-theme-font: [(${theme.config.style.font_size})];
}
</style>
<style no-pjax th:if="${not #strings.isEmpty(theme.config.style.content_padding)}" th:inline="css">
:root {
--spacing-theme-container-padding: [(${theme.config.style.content_padding})];
--spacing-theme-container-padding-mobile: [(${theme.config.style.content_padding})];
}
</style>
<script no-pjax>
window.TerminalTheme?.applyCustomCss?.();
</script>