Extending Default Theme
Customize CSS variables, use layout slots, register global components, and override theme fonts
Theme Entry File
// .vitepress/theme/index.ts
import DefaultTheme from 'vitepress/theme'
import './custom.css'
export default DefaultThemeCSS Variables
/* .vitepress/theme/custom.css */
:root {
/* Brand colors */
--vp-c-brand-1: #646cff;
--vp-c-brand-2: #747bff;
--vp-c-brand-3: #9499ff;
/* Backgrounds */
--vp-c-bg: #ffffff;
--vp-c-bg-soft: #f6f6f7;
/* Text */
--vp-c-text-1: #213547;
--vp-c-text-2: #476582;
}
.dark {
--vp-c-brand-1: #747bff;
--vp-c-bg: #1a1a1a;
}Home Hero Customization
Custom Fonts
Global Components
Layout Slots
Available Slots
Using Render Functions
Override Internal Components
View Transitions
Key Points
Last updated
Was this helpful?