Skip to content

Commit 366be4d

Browse files
committed
Update VitePress
1 parent 35f94c5 commit 366be4d

File tree

5 files changed

+528
-215
lines changed

5 files changed

+528
-215
lines changed

docs/.vitepress/config.ts renamed to docs/.vitepress/config.mts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,18 @@ export default defineConfigWithTheme({
1616
},
1717

1818
themeConfig: {
19-
socialLinks: [
20-
{ icon: 'github', link: 'https://github.com/skirtles-code/vue-vnode-utils' }
21-
],
19+
search: {
20+
provider: 'local'
21+
},
2222

2323
nav: [
2424
{ text: 'Guide', link: '/guide/introduction.html' }
2525
],
2626

27+
socialLinks: [
28+
{ icon: 'github', link: 'https://github.com/skirtles-code/vue-vnode-utils' }
29+
],
30+
2731
sidebar: [
2832
{
2933
text: 'Getting started',

docs/.vitepress/theme/index.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
import type { App } from 'vue'
1+
import type { Theme } from 'vitepress'
22
import DefaultTheme from 'vitepress/theme'
3+
import './styles.css'
34
import LiveExample from '../../components/live-example.vue'
45

5-
export default {
6-
...DefaultTheme,
7-
enhanceApp({ app }: { app: App }) {
6+
const theme: Theme = {
7+
extends: DefaultTheme,
8+
enhanceApp({ app }) {
89
app.component('live-example', LiveExample)
910
}
1011
}
12+
13+
export default theme

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
@@ -39,7 +39,7 @@
3939
"typescript": "^4.8.4",
4040
"vite": "^3.1.4",
4141
"vite-plugin-dts": "^1.6.4",
42-
"vitepress": "1.0.0-alpha.75",
42+
"vitepress": "1.0.0-rc.25",
4343
"vitest": "^0.24.0",
4444
"vue": "^3.2.0",
4545
"vue-tsc": "^0.40.13"

0 commit comments

Comments
 (0)