forked from stackblitz/tutorialkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathintegrations.ts
53 lines (49 loc) · 1.64 KB
/
integrations.ts
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import mdx from '@astrojs/mdx';
import react from '@astrojs/react';
import { pluginCollapsibleSections } from '@expressive-code/plugin-collapsible-sections';
import { pluginLineNumbers } from '@expressive-code/plugin-line-numbers';
import expressiveCode from 'astro-expressive-code';
import UnoCSS from 'unocss/astro';
export function extraIntegrations() {
return [
react(),
expressiveCode({
plugins: [pluginCollapsibleSections(), pluginLineNumbers()],
themes: ['dark-plus', 'light-plus'],
customizeTheme: (theme) => {
const isDark = theme.type === 'dark';
theme.styleOverrides = {
borderColor: 'var(--tk-border-secondary)',
borderWidth: '1px',
borderRadius: 'var(--code-border-radius, 0px)',
frames: {
terminalTitlebarBackground: `var(--tk-background-${isDark ? 'primary' : 'secondary'})`,
terminalTitlebarBorderBottomColor: `var(--tk-background-${isDark ? 'primary' : 'secondary'})`,
editorTabBorderRadius: 'var(--code-border-radius, 0px)',
editorTabBarBackground: `var(--tk-background-${isDark ? 'primary' : 'secondary'})`,
},
};
},
themeCssSelector: (theme) => {
let customThemeName = 'light';
if (theme.name === 'dark-plus') {
customThemeName = 'dark';
}
return `[data-theme='${customThemeName}']`;
},
defaultProps: {
showLineNumbers: false,
},
styleOverrides: {
frames: {
shadowColor: 'none',
},
},
}),
mdx(),
UnoCSS({
configDeps: ['./theme.ts'],
injectReset: true,
}),
];
}