-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathec.config.mjs
More file actions
32 lines (27 loc) · 1.1 KB
/
ec.config.mjs
File metadata and controls
32 lines (27 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import {
latte, frappe, macchiato, mocha
} from '@catppuccin/vscode'
import { pluginCollapsibleSections } from '@expressive-code/plugin-collapsible-sections'
import { pluginLineNumbers } from '@expressive-code/plugin-line-numbers'
import { defineEcConfig } from 'astro-expressive-code'
export default defineEcConfig({
plugins: [
pluginLineNumbers(),
pluginCollapsibleSections()
],
// 同时指定亮色和暗色主题(顺序很重要:light, dark)
themes: [latte, mocha], // 最常用:latte(亮) + mocha(暗)
// 或者你喜欢其他暗色口味:
// themes: [latte, frappe],
// themes: [latte, macchiato],
// 可选:如果你想让 Shiki 也用同样的主题(推荐)
themeCssSelector: (theme) => theme.type === 'dark' ? '[data-theme="dark"]' : '[data-theme="light"]',
styleOverrides: {
// 这里可以微调边框、代码文字大小等
borderRadius: '0.5rem',
codeFontSize: '0.95rem',
// 设置代码块字体,英文字体使用 JetBrainsMono,中文字体使用 MiSans
codeFontFamily: '"JetBrains Mono", "MiSans"',
// ...
},
})