feat: add media max width setting
This commit is contained in:
@@ -51,6 +51,13 @@ spec:
|
|||||||
value: false
|
value: false
|
||||||
help: 开启后文章内容中的 table 会占满正文内容区域宽度
|
help: 开启后文章内容中的 table 会占满正文内容区域宽度
|
||||||
|
|
||||||
|
- $formkit: text
|
||||||
|
label: 正文媒体最大宽度
|
||||||
|
name: media_max_width
|
||||||
|
value:
|
||||||
|
placeholder: "60%"
|
||||||
|
help: 控制文章内容中图片、视频、figure 的最大宽度, 留空使用主题默认值
|
||||||
|
|
||||||
- $formkit: checkbox
|
- $formkit: checkbox
|
||||||
label: 使用系统字体
|
label: 使用系统字体
|
||||||
name: system_font_enable
|
name: system_font_enable
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
--lig-theme-font: none;
|
--lig-theme-font: none;
|
||||||
--width-theme-border: calc(var(--size-theme-font) * 0.125);
|
--width-theme-border: calc(var(--size-theme-font) * 0.125);
|
||||||
--width-theme-table-border: calc(var(--size-theme-font) * 0.0625);
|
--width-theme-table-border: calc(var(--size-theme-font) * 0.0625);
|
||||||
|
--width-theme-media-max: 60%;
|
||||||
--style-theme-border: solid;
|
--style-theme-border: solid;
|
||||||
--style-theme-table-border: dashed;
|
--style-theme-table-border: dashed;
|
||||||
--style-theme-title-divider: dashed;
|
--style-theme-title-divider: dashed;
|
||||||
@@ -100,8 +101,6 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
body[layout_mode='fullscreen'] {
|
body[layout_mode='fullscreen'] {
|
||||||
--width-theme-media-max: calc(var(--size-theme-font) * 75);
|
|
||||||
|
|
||||||
.wrapper {
|
.wrapper {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
@@ -121,7 +120,7 @@ body[layout_mode='fullscreen'] {
|
|||||||
.content img,
|
.content img,
|
||||||
.content video,
|
.content video,
|
||||||
.content figure {
|
.content figure {
|
||||||
max-width: 60%;
|
max-width: var(--width-theme-media-max);
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -137,6 +137,11 @@
|
|||||||
<script no-pjax type="module" th:src="@{/assets/dist/main.js?v={version}(version=${theme.spec.version})}"></script>
|
<script no-pjax type="module" th:src="@{/assets/dist/main.js?v={version}(version=${theme.spec.version})}"></script>
|
||||||
<script no-pjax type="module" th:if="${theme.config.basic.pjax_enable}"
|
<script no-pjax type="module" th:if="${theme.config.basic.pjax_enable}"
|
||||||
th:src="@{/assets/dist/libs/pjax.js?v={version}(version=${theme.spec.version})}"></script>
|
th:src="@{/assets/dist/libs/pjax.js?v={version}(version=${theme.spec.version})}"></script>
|
||||||
|
<style no-pjax th:if="${not #strings.isEmpty(theme.config.style.media_max_width)}" th:inline="css">
|
||||||
|
:root {
|
||||||
|
--width-theme-media-max: [(${theme.config.style.media_max_width})];
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script no-pjax>
|
<script no-pjax>
|
||||||
window.TerminalTheme?.applyCustomCss?.();
|
window.TerminalTheme?.applyCustomCss?.();
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user