feat(styles): 初始化默认主题样式并支持暗黑模式

- 新增 default-theme.css 文件,定义基础样式和暗黑模式样式
-移除 index.css 文件中的重复样式
- 在 nuxt.config.js 中引入 default-theme.css
- 优化了颜色变量和布局样式
This commit is contained in:
xingyy 2025-01-23 14:10:15 +08:00
parent e541d0b21d
commit f80f9c1651
6 changed files with 22 additions and 5 deletions

View File

@ -52,7 +52,6 @@ provide('slideDirection', slideDirection)
</template>
<style>
@import "@/static/styles/index.css";
.slide-left-enter-active,
.slide-left-leave-active,
.slide-right-enter-active,

View File

@ -0,0 +1,21 @@
:root:root {
--c-primary: #3554AF;
--c-primary-active: #3554AF;
--van-primary-color: var(--c-primary);
--van-cell-group-inset-padding: 0;
}
#__nuxt {
margin: 0;
padding: 0;
}
html {
background: var(--van-gray-1);
color-scheme: light;
}
html.dark {
background: #222;
color-scheme: dark;
}

View File

View File

@ -1,3 +0,0 @@
:root{
--van-primary-color:'#2B53AC';
}

View File

View File

@ -40,8 +40,8 @@ export default defineNuxtConfig({
// CSS 配置
css: [
'@unocss/reset/tailwind.css', // 重置默认样式
'@/static/styles/default-theme.css',
],
// PostCSS 配置
postcss: {
plugins: {