feat: ppst-vitepress-theme

This commit is contained in:
ppst
2023-04-06 22:39:02 +08:00
commit a329fd9116
68 changed files with 4769 additions and 0 deletions

38
demo/.vitepress/config.ts Normal file
View File

@@ -0,0 +1,38 @@
const { getPosts } = require('markdown-from-posts')
async function config() {
return {
extends: {
markdown: {
headers: {
level: [2, 3]
}
},
},
themeConfig: {
posts: await getPosts(),
title: 'BBBB',
description: '自定义主题BBBB',
docRoot: '',
hasDarkSwitch: true,
homeConfig: {
headline: 'BBBB大标题',//大标题
headlineHeight: 'BBBB高亮',//大标题高亮
subheading: 'BBBB小标题',//小标题
subheadingHeight: '小标题高亮',//小标题高亮
description: '自定义主题简短banner描述',//描述
},
nav: [
{ text: '首页', link: '/', icon: '' },
{ text: '归档', link: '/pages/archives', icon: '' },
{ text: '默认', link: '/pages/default', icon: '' },
{ text: '分类', link: '/pages/category', icon: '' },
{ text: '搜索', link: '/pages/search', icon: '' },
],
footer: {
copyright: '湘ICP备aaaaaaaa-1'
}
}
}
}
module.exports = config()

View File

@@ -0,0 +1,12 @@
import { CustomTheme } from 'ppst-vitepress-theme'
// import { h } from 'vue'
import './override.css'
export default {
...CustomTheme,
// Layout() {
// return h(CustomTheme.Layout, null, {
// })
// }
}

View File

@@ -0,0 +1,97 @@
:root {
--c-main-color:#80adff;
}
/* card */
.news-box {
display: flex;
align-items: center;
width: 100%;
margin: 0 auto;
padding: 20px 0;
}
.news-box .card-item {
flex-basis: 25%;
padding: 15px;
transition: all 0.3s ease;
}
.news-box .card-item .item-box {
display: flex;
flex-direction: column;
align-items: center;
border-radius: 15px;
padding: 15px;
margin-bottom: 140px;
background: #f8f8fc;
transition: all 0.3s ease;
}
.news-box .card-item .item-box .icon {
font-size: 48px;
color: var(--c-main-color);
}
.news-box .card-item .item-box .title {
font-size: 18px;
line-height: 2;
font-weight: 500;
color: #020312;
}
.news-box .card-item .item-box .desc {
font-size: 16px;
line-height: 2;
color: #717e96;
overflow: hidden;
}
.news-box .card-item .item-box .desc {
font-size: 16px;
line-height: 2;
color: #717e96;
}
.news-box .card-item:hover .item-box {
background: var(--c-main-color);
transition: all 0.3s ease;
}
.news-box .card-item .item-box.active {
background: var(--c-main-color);
margin-bottom: 0;
}
.news-box .card-item:hover .item-box .icon,
.news-box .card-item:hover .item-box .title,
.news-box .card-item:hover .item-box .desc,
.news-box .card-item .item-box.active .icon,
.news-box .card-item .item-box.active .title,
.news-box .card-item .item-box.active .desc {
color: #fff;
}
@media (max-width: 1200px) {
.banner .banner-left {
font-size: 14px;
}
.banner .banner-left .desc {
font-size: 12px;
}
.note-box {
flex-wrap: wrap;
}
.note-box .note-item {
flex-basis: 100%;
}
.news-box {
flex-wrap: wrap;
}
.news-box .card-item {
flex-basis: 100%;
}
.news-box .card-item .item-box {
margin-bottom: 0;
}
.news-box .card-item .item-box .title {
font-size: 14px;
}
.news-box .card-item .item-box .desc {
font-size: 12px;
}
}