feat: add option to use system font
This commit is contained in:
@@ -28,6 +28,11 @@ spec:
|
||||
- group: style
|
||||
label: 样式设置
|
||||
formSchema:
|
||||
- $formkit: checkbox
|
||||
label: 使用系统字体
|
||||
name: system_font
|
||||
value: false
|
||||
help: 开启后将优先使用访问者的系统字体
|
||||
- $formkit: checkbox
|
||||
name: pixel_style
|
||||
label: 像素化风格
|
||||
|
||||
@@ -15,8 +15,9 @@
|
||||
--line-theme-height: calc(var(--font-theme-size) * 1.54);
|
||||
--radius-theme-default: 0;
|
||||
--font-theme-default: 'JetBrains Mono';
|
||||
--font-theme-fallback: Monaco, Consolas, -apple-system, BlinkMacSystemFont, 'segoe ui',
|
||||
Roboto, Oxygen, Ubuntu, Cantarell, 'open sans', 'helvetica neue';
|
||||
--font-theme-fallback: -apple-system, BlinkMacSystemFont, 'segoe ui', Roboto, Oxygen,
|
||||
Ubuntu, Cantarell, 'open sans', 'helvetica neue', Arial, 'Noto Sans',
|
||||
'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
|
||||
--scrollbar-theme-width: thin;
|
||||
--scrollbar-theme-color: rgba(134, 134, 134, 0.45) rgba(255, 255, 255, 0);
|
||||
--font-theme-lig: none;
|
||||
@@ -31,6 +32,10 @@ html[pixel_style='true'] {
|
||||
--font-theme-default: 'Fusion Pixel 12px P zh_hans';
|
||||
}
|
||||
|
||||
html[system_font='true']:not([pixel_style='true']) {
|
||||
--font-theme-default: var(--font-theme-fallback);
|
||||
}
|
||||
|
||||
* {
|
||||
scrollbar-width: var(--scrollbar-theme-width) !important;
|
||||
scrollbar-color: var(--scrollbar-theme-color);
|
||||
|
||||
@@ -8,6 +8,10 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<title th:text="${title}"></title>
|
||||
<script no-pjax th:inline="javascript">
|
||||
let system_font = /*[[${theme.config.style.system_font}]]*/;
|
||||
document.documentElement.setAttribute("system_font", system_font);
|
||||
</script>
|
||||
<script no-pjax th:inline="javascript">
|
||||
let dark_theme = /*[[${theme.config.style.dark_color_schema}]]*/;
|
||||
let light_theme = /*[[${theme.config.style.light_color_schema}]]*/;
|
||||
|
||||
Reference in New Issue
Block a user