Skip to content

Commit 132f7ca

Browse files
committed
Update VitePress
1 parent 15e9cff commit 132f7ca

File tree

5 files changed

+588
-255
lines changed

5 files changed

+588
-255
lines changed
File renamed without changes.

docs/.vitepress/theme/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import DefaultTheme from 'vitepress/theme'
2+
import './styles.css'
23
import LiveExample from '../components/live-example.vue'
34

45
export default {
5-
...DefaultTheme,
6+
extends: DefaultTheme,
67
enhanceApp({ app }) {
78
app.component('live-example', LiveExample)
89
}

docs/.vitepress/theme/styles.css

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
:root {
2+
/* Switch the theme to green */
3+
--vp-c-brand-1: var(--vp-c-green-1);
4+
--vp-c-brand-2: var(--vp-c-green-2);
5+
--vp-c-brand-3: var(--vp-c-green-3);
6+
--vp-c-brand-soft: var(--vp-c-green-soft);
7+
8+
/* green-1 is too dark, so use green-2 instead */
9+
--vp-home-hero-name-color: var(--vp-c-brand-2);
10+
11+
/* Revert inline code to the old theme, so it doesn't look like a link */
12+
--vp-code-color: #476582;
13+
14+
/* Put borders on code and custom blocks */
15+
--custom-code-block-border: var(--vp-c-divider);
16+
17+
--vp-custom-block-danger-border: hsla(358, 75%, 44%, 0.4);
18+
--vp-custom-block-warning-border: hsla(32, 95%, 44%, 0.4);
19+
--vp-custom-block-tip-border: hsla(153, 25%, 44%, 0.4);
20+
--vp-custom-block-info-border: hsla(240, 10%, 64%, 0.4);
21+
}
22+
23+
/* Borders on custom blocks in dark mode */
24+
html:not(.dark) {
25+
--vp-custom-block-danger-bg: hsl(350, 81%, 96%);
26+
--vp-custom-block-warning-bg: hsl(45, 93%, 94%);
27+
--vp-custom-block-tip-bg: hsl(160, 81%, 98%);
28+
--vp-custom-block-info-bg: hsl(240, 6%, 97%);
29+
}
30+
31+
.dark {
32+
/* Inline code for the dark theme */
33+
--vp-code-color: #c9def1;
34+
}
35+
36+
/* Apply a border to code blocks and code groups */
37+
.vp-doc div[class*='language-'] {
38+
border: 1px solid var(--custom-code-block-border);
39+
}
40+
41+
.vp-code-group > .tabs {
42+
border: 1px solid var(--custom-code-block-border);
43+
border-bottom: 0 none;
44+
}
45+
46+
.vp-code-group > .blocks > div[class*='language-'] {
47+
border-top: 0 none;
48+
}
49+
50+
/* green-1 is much too close to black in the sidebar */
51+
html:not(.dark) .VPSidebar {
52+
--vp-c-brand-1: var(--vp-c-brand-3);
53+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
"vue": "^3.2.47"
1313
},
1414
"devDependencies": {
15-
"vitepress": "^1.0.0-alpha.75"
15+
"vitepress": "^1.0.0-rc.25"
1616
}
1717
}

0 commit comments

Comments
 (0)