Skip to content

Commit a2bf183

Browse files
committed
docs: update style
1 parent 302ca27 commit a2bf183

5 files changed

Lines changed: 59 additions & 7 deletions

File tree

typ/_template/template.typ

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,6 @@
387387
show-metadata: true,
388388
expanded: true,
389389
disable-numbering: false,
390-
level: 2,
391390
..attrs,
392391
) = {
393392
context counter("transclusion-depth").update(x => x + 1)
@@ -398,7 +397,7 @@
398397
show-metadata: show-metadata,
399398
expanded: expanded,
400399
disable-numbering: disable-numbering,
401-
body,
400+
html.div(body),
402401
..attrs,
403402
)
404403

@@ -499,8 +498,9 @@
499498
html.link(rel: "preconnect", href: "https://fonts.gstatic.com", crossorigin: "anonymous")
500499
html.link(
501500
rel: "stylesheet",
502-
href: "https://fonts.googleapis.com/css2?family=Libertinus+Sans:ital,wght@0,400;0,700;1,400&family=Libertinus+Math&family=Libertinus+Serif+Display&family=Libertinus+Serif:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&display=swap",
501+
href: "https://fonts.googleapis.com/css2?family=Source+Sans+3:ital,wght@0,200..900;1,200..900&family=Source+Serif+4:ital,opsz,wght@0,8..60,200..900;1,8..60,200..900&display=swap",
503502
)
503+
html.link(rel: "stylesheet", href: "/css/stix-two-math.css")
504504
html.meta(name: "identifier", content: identifier)
505505
html.meta(name: "lang", content: lang)
506506
html.title(plain-text(title))

typ/public/css/stix-two-math.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@font-face {
2+
font-family: STIX Two Math;
3+
src: local('STIX Two Math'),
4+
url('/fonts/STIXTwoMath-Regular.woff2'),
5+
url('/fonts/STIXTwoMath-Regular.woff');
6+
font-weight: normal;
7+
font-style: normal;
8+
}

typ/public/css/weibian.css

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,12 @@
4040
--color-mark: light-dark(#dae5ec, #2f3849); /* bg-hl-line */
4141

4242
/* Typography */
43-
--font-body: "Libertinus Sans", sans-serif;
44-
--font-heading: "Libertinus Serif Display", "Libertinus Serif", serif;
43+
--font-body-sans: "Source Sans 3", sans-serif;
44+
--font-body-serif: "Source Serif 4", serif;
45+
--font-body: var(--font-body-sans);
46+
--font-heading: "Source Serif 4", serif;
47+
48+
--font-math: "STIX Two Math", math;
4549
--font-size-base: 1.125rem;
4650
--font-size-sm: 1rem;
4751
--font-size-xs: 0.875rem;
@@ -133,7 +137,7 @@ pre {
133137
}
134138

135139
math {
136-
font-family: "Libertinus Math", math;
140+
font-family: var(--font-math);
137141
}
138142

139143
.math-display {
@@ -237,7 +241,7 @@ address {
237241

238242
#grid-wrapper {
239243
display: grid;
240-
grid-template-columns: 1fr minmax(auto, 90ex) 1fr;
244+
grid-template-columns: 1fr minmax(auto, 80ex) 1fr;
241245
gap: var(--space-sm);
242246
}
243247

@@ -925,3 +929,43 @@ footer > section {
925929
bottom: 0.1rem;
926930
}
927931
}
932+
933+
/* ========================================
934+
Chinese Font Support
935+
======================================== */
936+
section:lang(zh) {
937+
/* Chinese Font Classes (https://github.com/zenozeng/fonts.css) */
938+
--font-hei:
939+
-apple-system, "Noto Sans", "Helvetica Neue", Helvetica,
940+
"Nimbus Sans L", Arial, "Liberation Sans", "PingFang SC",
941+
"Hiragino Sans GB", "Noto Sans CJK SC", "Source Han Sans SC",
942+
"Source Han Sans CN", "Microsoft YaHei", "Wenquanyi Micro Hei",
943+
"WenQuanYi Zen Hei", "ST Heiti", SimHei, "WenQuanYi Zen Hei Sharp",
944+
sans-serif;
945+
--font-kai:
946+
Baskerville, Georgia, "Liberation Serif", "Kaiti SC", STKaiti,
947+
"AR PL UKai CN", "AR PL UKai HK", "AR PL UKai TW", "AR PL UKai TW MBE",
948+
"AR PL KaitiM GB", KaiTi, KaiTi_GB2312, DFKai-SB, "TW\-Kai", serif;
949+
--font-song:
950+
Georgia, "Nimbus Roman No9 L", "Songti SC", "Noto Serif CJK SC",
951+
"Source Han Serif SC", "Source Han Serif CN", STSong, "AR PL New Sung",
952+
"AR PL SungtiL GB", NSimSun, SimSun, "TW\-Sung",
953+
"WenQuanYi Bitmap Song", "AR PL UMing CN", "AR PL UMing HK",
954+
"AR PL UMing TW", "AR PL UMing TW MBE", PMingLiU, MingLiU, serif;
955+
--font-fang-song:
956+
Baskerville, "Times New Roman", "Liberation Serif", STFangsong,
957+
FangSong, FangSong_GB2312, "CWTEX\-F", serif;
958+
959+
font-family: var(--font-body), var(--font-hei);
960+
961+
.poem {
962+
font-family: var(--font-body-serif), var(--font-song);
963+
p {
964+
white-space: pre;
965+
}
966+
}
967+
968+
:is(h1, h2, h3, h4, h5, h6) {
969+
font-family: var(--font-heading), var(--font-song);
970+
}
971+
}
627 KB
Binary file not shown.
539 KB
Binary file not shown.

0 commit comments

Comments
 (0)