File tree Expand file tree Collapse file tree 3 files changed +15
-10
lines changed Expand file tree Collapse file tree 3 files changed +15
-10
lines changed Original file line number Diff line number Diff line change 4
4
5
5
html : has (.landing ) {
6
6
--vp-c-bg : # 101010 ;
7
-
8
7
background-color : # 101010 ;
9
-
10
- body {
11
- background-color : # 101010 ;
12
- }
13
8
}
14
9
15
10
.landing {
16
11
overflow-x : hidden;
17
- background-color : # 101010 ;
18
12
19
13
* {
20
14
-webkit-font-smoothing : antialiased !important ;
Original file line number Diff line number Diff line change 1
1
---
2
2
title : Vite
3
3
titleTemplate : Next Generation Frontend Tooling
4
+ # add `dark` here to apply dark mode on initial load,
5
+ # since `onMounted` doesn't run during SSR
4
6
pageClass : landing dark
5
7
6
8
layout : home
@@ -10,6 +12,9 @@ markdownStyles: false
10
12
---
11
13
12
14
<script setup >
15
+ import { useData } from ' vitepress'
16
+ import { onBeforeUnmount , onMounted , ref } from ' vue'
17
+
13
18
import Hero from ' .vitepress/theme/components/landing/1. hero-section/HeroSection.vue'
14
19
import FeatureSection from ' ./.vitepress/theme/components/landing/2. feature-section/FeatureSection.vue'
15
20
import FrameworksSection from ' ./.vitepress/theme/components/landing/3. frameworks-section/FrameworksSection.vue'
@@ -24,6 +29,16 @@ import FeatureFlexiblePlugins from './.vitepress/theme/components/landing/2. fea
24
29
import FeatureTypedAPI from ' ./.vitepress/theme/components/landing/2. feature-section/FeatureTypedAPI.vue'
25
30
import FeatureSSRSupport from ' ./.vitepress/theme/components/landing/2. feature-section/FeatureSSRSupport.vue'
26
31
import FeatureCI from ' ./.vitepress/theme/components/landing/2. feature-section/FeatureCI.vue'
32
+
33
+ const { isDark } = useData ()
34
+
35
+ onMounted (() => {
36
+ document .documentElement .classList .add (' dark' )
37
+ })
38
+
39
+ onBeforeUnmount (() => {
40
+ document .documentElement .classList .toggle (' dark' , isDark .value )
41
+ })
27
42
</script >
28
43
29
44
<div class =" VPHome " >
Original file line number Diff line number Diff line change @@ -20,10 +20,6 @@ patchedDependencies:
20
20
peerDependencyRules :
21
21
allowedVersions :
22
22
vite : " *"
23
- ignoreMissing :
24
- - " @algolia/client-search"
25
- - " postcss"
26
- - " search-insights"
27
23
packageExtensions :
28
24
sass-embedded :
29
25
peerDependencies :
You can’t perform that action at this time.
0 commit comments