feat: 添加 Sarasa Mono 字体支持并优化样式

This commit is contained in:
2026-04-12 13:29:17 +08:00
parent c0c0cc19b2
commit af78359d94
5 changed files with 233 additions and 8 deletions

View File

@@ -1,10 +1,25 @@
@import url('../../bs3/bootstrap.min.css');
@font-face {
font-family: 'Sarasa Mono SC Local';
src: local('等距更纱黑体 SC'),
local('Sarasa Mono SC'),
url('../fonts/SarasaMonoSC-Regular.ttf') format('truetype');
font-weight: 400;
font-style: normal;
font-display: swap;
}
:root {
--hustoj-global-mono-font: "Sarasa Mono SC", "Sarasa Fixed SC",
--hustoj-global-mono-font: 'Sarasa Mono SC Local', "Sarasa Mono SC", "Sarasa Fixed SC",
"Sarasa Gothic SC", Consolas, "Cascadia Mono", "Cascadia Code",
"Fira Mono", "JetBrains Mono", "Liberation Mono", Menlo, Monaco,
"Courier New", monospace;
--hustoj-global-font-size: 26px;
--hustoj-global-line-height: 1.6;
--hustoj-global-code-font-size: 24px;
--hustoj-global-heading-size: 30px;
--hustoj-global-subheading-size: 28px;
}
.ui.header,
@@ -30,6 +45,8 @@ h4,
h5,
body {
font-family: var(--hustoj-global-mono-font) !important;
font-size: var(--hustoj-global-font-size) !important;
line-height: var(--hustoj-global-line-height);
}
a.black-link {
@@ -42,12 +59,29 @@ a.black-link:hover {
.font-content {
font-family: var(--hustoj-global-mono-font) !important;
font-size: var(--hustoj-global-font-size) !important;
line-height: var(--hustoj-global-line-height);
}
.markdown-edit {
font-family: var(--hustoj-global-mono-font) !important;
}
h1,
.ui.header.huge,
.ui.header.large {
font-size: var(--hustoj-global-heading-size) !important;
}
h2,
h3,
h4,
h5,
.ui.header,
.ui.top.attached.block.header {
font-size: var(--hustoj-global-subheading-size) !important;
}
.ui.form textarea,
.ui.form select,
.ui.text.container,
@@ -72,6 +106,49 @@ a.black-link:hover {
.ace_line,
.ace_text-layer {
font-family: var(--hustoj-global-mono-font) !important;
font-size: var(--hustoj-global-font-size) !important;
line-height: var(--hustoj-global-line-height) !important;
}
.ui.button,
.ui.input input,
.ui.form textarea,
.ui.form select,
.ui.message,
.ui.label,
.ui.dropdown,
.ui.table,
.ui.card > .content,
.ui.cards > .card > .content,
.ui.list > .item,
.ui.list .list > .item,
.ui.statistic > .value,
.ui.statistic > .label,
.vditor,
.vditor-reset,
.vditor-reset *,
pre,
code,
.ace_editor,
.ace_editor textarea,
.ace_content,
.ace_gutter,
.ace_line,
.ace_text-layer {
font-size: var(--hustoj-global-font-size) !important;
}
pre,
code,
.ace_editor,
.ace_editor textarea,
.ace_content,
.ace_gutter,
.ace_line,
.ace_text-layer,
.sample-box code,
.vditor-reset pre code {
font-size: var(--hustoj-global-code-font-size) !important;
}
.padding {

Binary file not shown.

View File

@@ -697,6 +697,8 @@ if ($pr_flag) {
return HustOJVditor.renderMarkdownBlocks('.md').then(function () {
addMarkdownInputOutputLabels();
styleMarkdownTables();
$('.md .hustoj-vditor-sample-heading').addClass('ui top attached block header sample-header');
$('.md pre.hustoj-vditor-sample-box').addClass('ui bottom attached segment font-content sample-box');
});
<?php } ?>
return Promise.resolve([]);