feat:增加字体
This commit is contained in:
27
docs/.vitepress/theme/components/CustomComponent.vue
Normal file
27
docs/.vitepress/theme/components/CustomComponent.vue
Normal file
@@ -0,0 +1,27 @@
|
||||
<template>
|
||||
<div class="custom-component">
|
||||
<h3>{{ title }}</h3>
|
||||
<p>{{ description }}</p>
|
||||
<button @click="count++">点击次数: {{ count }}</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
|
||||
const props = defineProps({
|
||||
title: String,
|
||||
description: String
|
||||
})
|
||||
|
||||
const count = ref(0)
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.custom-component {
|
||||
border: 1px solid #e2e2e2;
|
||||
padding: 1rem;
|
||||
border-radius: 8px;
|
||||
margin: 1rem 0;
|
||||
}
|
||||
</style>
|
||||
BIN
docs/.vitepress/theme/fonts/custom.woff2
Normal file
BIN
docs/.vitepress/theme/fonts/custom.woff2
Normal file
Binary file not shown.
12
docs/.vitepress/theme/index.ts
Normal file
12
docs/.vitepress/theme/index.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import DefaultTheme from 'vitepress/theme'
|
||||
|
||||
import '../theme/style.css'
|
||||
|
||||
// 定义组件导入的类型
|
||||
interface ComponentModule {
|
||||
default: any
|
||||
}
|
||||
|
||||
export default {
|
||||
extends: DefaultTheme
|
||||
}
|
||||
19
docs/.vitepress/theme/style.css
Normal file
19
docs/.vitepress/theme/style.css
Normal file
@@ -0,0 +1,19 @@
|
||||
@font-face {
|
||||
font-family: 'CustomFont';
|
||||
src: url('./fonts/custom.woff2') format('woff2');
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
:root {
|
||||
--vp-font-family-base: 'CustomFont', -apple-system, BlinkMacSystemFont,
|
||||
'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
|
||||
--vp-font-family-mono: 'CustomFont', 'Fira Code', 'Consolas', monospace;
|
||||
}
|
||||
|
||||
:root {
|
||||
--vp-c-brand: #10b981;
|
||||
--vp-c-brand-light: #34d399;
|
||||
--vp-c-brand-lighter: #6ee7b7;
|
||||
--vp-c-brand-dark: #059669;
|
||||
--vp-c-brand-darker: #047857;
|
||||
}
|
||||
Reference in New Issue
Block a user