实现切换侧边栏导航之前
This commit is contained in:
22
docs/.vitepress/theme/Layout.vue
Normal file
22
docs/.vitepress/theme/Layout.vue
Normal file
@@ -0,0 +1,22 @@
|
||||
<script setup>
|
||||
import { useData } from 'vitepress'
|
||||
import DefaultTheme from 'vitepress/theme'
|
||||
import Index from '../components/Index.vue' // 你的组件
|
||||
|
||||
const { Layout } = DefaultTheme
|
||||
const { frontmatter } = useData()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Layout>
|
||||
<!-- 保留默认主题的所有插槽 -->
|
||||
<template #home-hero>
|
||||
<VPHomeHero /> <!-- 默认Hero区域 -->
|
||||
<Index /> <!-- 你的自定义组件 -->
|
||||
</template>
|
||||
|
||||
<template #home-features>
|
||||
<VPHomeFeatures /> <!-- 默认Features区域 -->
|
||||
</template>
|
||||
</Layout>
|
||||
</template>
|
@@ -1,6 +0,0 @@
|
||||
/* .vitepress/theme/custom.css */
|
||||
.bold-item {
|
||||
font-weight: 700 !important;
|
||||
font-size: 1em !important;
|
||||
/* 与其他目录项字号一致 */
|
||||
}
|
5
docs/.vitepress/theme/index.js
Normal file
5
docs/.vitepress/theme/index.js
Normal file
@@ -0,0 +1,5 @@
|
||||
// 正确写法:继承默认主题
|
||||
import DefaultTheme from 'vitepress/theme'
|
||||
import './style.css' // 可选:你的自定义样式
|
||||
|
||||
export default DefaultTheme // ✅ 必须导出 default
|
40
docs/.vitepress/theme/style.css
Normal file
40
docs/.vitepress/theme/style.css
Normal file
@@ -0,0 +1,40 @@
|
||||
/* 强制覆盖主题默认的Logo尺寸 */
|
||||
.VPImage.logo {
|
||||
height: 150px !important;
|
||||
/* 必须用 !important 覆盖主题的 !important */
|
||||
width: 200px !important;
|
||||
/* 固定宽度,防止变形 */
|
||||
/* margin-left: 100px !important; */
|
||||
margin-right: -50px !important;
|
||||
margin-left: -40px !important;
|
||||
}
|
||||
|
||||
.VPNavBar .title {
|
||||
margin-right: 20px !important;
|
||||
}
|
||||
|
||||
.VPHero .text {
|
||||
font-size: 50px !important;
|
||||
}
|
||||
|
||||
/* 移除掉目录之间的分割线 */
|
||||
.group {
|
||||
border-top: 0 !important;
|
||||
|
||||
/* padding-bottom: 0 !important; */
|
||||
.items {
|
||||
font-size: 20px !important;
|
||||
}
|
||||
}
|
||||
|
||||
.group .items {
|
||||
font-size: 16px !important;
|
||||
color: #3c3c43 !important;
|
||||
font-weight: 700px !important;
|
||||
}
|
||||
|
||||
|
||||
/* .VPHero .image-container img {
|
||||
width: 1000px !important;
|
||||
height: 300px !important;
|
||||
} */
|
Reference in New Issue
Block a user