File tree Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change 44
55html : has (.landing ) {
66 --vp-c-bg : # 101010 ;
7-
87 background-color : # 101010 ;
9-
10- body {
11- background-color : # 101010 ;
12- }
138}
149
1510.landing {
1611 overflow-x : hidden;
17- background-color : # 101010 ;
1812
1913 * {
2014 -webkit-font-smoothing : antialiased !important ;
Original file line number Diff line number Diff line change 11---
22title : Vite
33titleTemplate : 次世代フロントエンドツール
4+ # add `dark` here to apply dark mode on initial load,
5+ # since `onMounted` doesn't run during SSR
46pageClass : landing dark
57
68layout : home
@@ -10,6 +12,9 @@ markdownStyles: false
1012---
1113
1214<script setup >
15+ import { useData } from ' vitepress'
16+ import { onBeforeUnmount , onMounted , ref } from ' vue'
17+
1318import Hero from ' .vitepress/theme/components/landing/1. hero-section/HeroSection.vue'
1419import FeatureSection from ' ./.vitepress/theme/components/landing/2. feature-section/FeatureSection.vue'
1520import FrameworksSection from ' ./.vitepress/theme/components/landing/3. frameworks-section/FrameworksSection.vue'
@@ -24,6 +29,16 @@ import FeatureFlexiblePlugins from './.vitepress/theme/components/landing/2. fea
2429import FeatureTypedAPI from ' ./.vitepress/theme/components/landing/2. feature-section/FeatureTypedAPI.vue'
2530import FeatureSSRSupport from ' ./.vitepress/theme/components/landing/2. feature-section/FeatureSSRSupport.vue'
2631import 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+ })
2742</script >
2843
2944<div class =" VPHome " >
You can’t perform that action at this time.
0 commit comments