Skip to content

Commit 2febfd2

Browse files
committed
导入字体,优化代码块样式
1 parent 209806c commit 2febfd2

File tree

4 files changed

+26
-0
lines changed

4 files changed

+26
-0
lines changed

astro.config.mjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,11 @@ export default defineConfig({
2727
}),
2828
},
2929
},
30+
markdown: {
31+
shikiConfig: {
32+
// 从 Shiki 的内置主题中选择 (或者添加你自己的)
33+
// https://shiki.style/themes
34+
theme: 'one-light',
35+
}
36+
}
3037
});
64.8 KB
Binary file not shown.

src/styles/global.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,11 @@ p {
4444
a {
4545
color: unset;
4646
}
47+
48+
@font-face {
49+
font-family: "Maple Mono";
50+
src: url("../../public/fonts/MapleMono-Regular.woff2") format("woff");
51+
font-weight: normal;
52+
font-style: normal;
53+
font-display: swap;
54+
}

src/styles/markdown.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,15 @@
2626
p:last-of-type {
2727
margin-bottom: 0;
2828
}
29+
30+
pre:has(code) {
31+
padding: 0 2rem;
32+
}
33+
34+
code {
35+
font-family: "Maple Mono", sans-serif;
36+
font-size: 0.9rem;
37+
}
38+
39+
2940
}

0 commit comments

Comments
 (0)