feat(styles): 初始化默认主题样式并支持暗黑模式
- 新增 default-theme.css 文件,定义基础样式和暗黑模式样式 -移除 index.css 文件中的重复样式 - 在 nuxt.config.js 中引入 default-theme.css - 优化了颜色变量和布局样式
This commit is contained in:
parent
e541d0b21d
commit
f80f9c1651
@ -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,
|
||||
|
21
app/static/styles/default-theme.css
Normal file
21
app/static/styles/default-theme.css
Normal 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;
|
||||
}
|
0
app/static/styles/global.css
Normal file
0
app/static/styles/global.css
Normal file
@ -1,3 +0,0 @@
|
||||
:root{
|
||||
--van-primary-color:'#2B53AC';
|
||||
}
|
0
app/static/styles/vars.css
Normal file
0
app/static/styles/vars.css
Normal file
@ -40,8 +40,8 @@ export default defineNuxtConfig({
|
||||
// CSS 配置
|
||||
css: [
|
||||
'@unocss/reset/tailwind.css', // 重置默认样式
|
||||
'@/static/styles/default-theme.css',
|
||||
],
|
||||
|
||||
// PostCSS 配置
|
||||
postcss: {
|
||||
plugins: {
|
||||
|
Loading…
Reference in New Issue
Block a user