fix: 统一主题色彩系统,优化底部导航栏间距
All checks were successful
Docker Build & Deploy / Build Docker Image (push) Successful in 22s
Docker Build & Deploy / Deploy to Production (push) Successful in 6s
Docker Build & Deploy / Cleanup Dangling Images (push) Successful in 1s
Docker Build & Deploy / WeChat Notification (push) Successful in 1s
All checks were successful
Docker Build & Deploy / Build Docker Image (push) Successful in 22s
Docker Build & Deploy / Deploy to Production (push) Successful in 6s
Docker Build & Deploy / Cleanup Dangling Images (push) Successful in 1s
Docker Build & Deploy / WeChat Notification (push) Successful in 1s
- 新建 theme.css 定义 CSS 变量,统一亮色/暗色主题色彩 - 新建 layout.css 优化底部导航栏布局 - 在 App.vue 中添加 Vant UI 主题变量映射 - 修复底部导航栏与屏幕底部间距过大问题 - 添加安全区域(safe-area-inset)处理
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<template>
|
||||
<van-config-provider
|
||||
:theme="theme"
|
||||
:theme-vars="themeVars"
|
||||
class="app-provider"
|
||||
>
|
||||
<div class="app-root">
|
||||
@@ -153,6 +154,23 @@ const showTabbar = computed(() => {
|
||||
const active = ref('')
|
||||
const theme = ref('light')
|
||||
|
||||
// Vant UI 主题变量映射
|
||||
const themeVars = computed(() => {
|
||||
const vars = {
|
||||
navBarBackground: 'var(--bg-primary)',
|
||||
navBarTextColor: 'var(--text-primary)',
|
||||
cardBackground: 'var(--bg-secondary)',
|
||||
cellBackground: 'var(--bg-secondary)',
|
||||
background: 'var(--bg-primary)',
|
||||
background2: 'var(--bg-secondary)',
|
||||
textColor: 'var(--text-primary)',
|
||||
textColor2: 'var(--text-secondary)',
|
||||
borderColor: 'var(--bg-tertiary)',
|
||||
tabbarBackground: 'var(--bg-primary)'
|
||||
}
|
||||
return vars
|
||||
})
|
||||
|
||||
// 检测系统深色模式
|
||||
const updateTheme = () => {
|
||||
const isDark = window.matchMedia('(prefers-color-scheme: dark)').matches
|
||||
@@ -257,12 +275,19 @@ const handleAddTransactionSuccess = () => {
|
||||
height: auto !important;
|
||||
min-height: 50px !important;
|
||||
box-sizing: content-box !important;
|
||||
background: var(--bg-primary) !important;
|
||||
border-top: 1px solid var(--bg-tertiary);
|
||||
}
|
||||
|
||||
/* 确保 TabBar 项目居中 */
|
||||
:deep(.van-tabbar-item) {
|
||||
padding: 0 !important;
|
||||
height: 50px !important;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
:deep(.van-tabbar-item--active) {
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
.debug-overlay {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import './assets/main.css'
|
||||
import './assets/theme.css'
|
||||
import './styles/theme.css'
|
||||
import './styles/layout.css'
|
||||
import './styles/common.css'
|
||||
import './styles/rich-content.css'
|
||||
|
||||
|
||||
29
Web/src/styles/layout.css
Normal file
29
Web/src/styles/layout.css
Normal file
@@ -0,0 +1,29 @@
|
||||
/* EmailBill 布局样式 - 底部导航栏优化 */
|
||||
|
||||
/* 底部导航栏容器 */
|
||||
.van-tabbar {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 100;
|
||||
background: var(--bg-primary);
|
||||
border-top: 1px solid var(--bg-tertiary);
|
||||
height: 56px; /* 标准高度 */
|
||||
padding-bottom: env(safe-area-inset-bottom, 0px); /* 仅保留安全区域内边距 */
|
||||
background: var(--bg-primary) !important;
|
||||
}
|
||||
|
||||
/* 导航项样式 */
|
||||
.van-tabbar-item {
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.van-tabbar-item--active {
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
/* 页面内容区域需要为底部导航栏留出空间 */
|
||||
.page-content {
|
||||
padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
|
||||
}
|
||||
37
Web/src/styles/theme.css
Normal file
37
Web/src/styles/theme.css
Normal file
@@ -0,0 +1,37 @@
|
||||
/* EmailBill 主题颜色系统 */
|
||||
|
||||
:root {
|
||||
/* 亮色主题 - 背景色系统 */
|
||||
--bg-primary: #FFFFFF;
|
||||
--bg-secondary: #F6F7F8;
|
||||
--bg-tertiary: #F5F5F5;
|
||||
|
||||
/* 亮色主题 - 文本色系统 */
|
||||
--text-primary: #1A1A1A;
|
||||
--text-secondary: #6B7280;
|
||||
--text-tertiary: #9CA3AF;
|
||||
|
||||
/* 语义色 */
|
||||
--color-primary: #3B82F6;
|
||||
--color-danger: #FF6B6B;
|
||||
--color-success: #07C160;
|
||||
--color-warning: #FAAD14;
|
||||
}
|
||||
|
||||
[data-theme="dark"] {
|
||||
/* 暗色主题 - 背景色系统 */
|
||||
--bg-primary: #09090B;
|
||||
--bg-secondary: #18181B;
|
||||
--bg-tertiary: #27272A;
|
||||
|
||||
/* 暗色主题 - 文本色系统 */
|
||||
--text-primary: #F4F4F5;
|
||||
--text-secondary: #A1A1AA;
|
||||
--text-tertiary: #71717A;
|
||||
|
||||
/* 语义色在暗色模式下保持不变或微调 */
|
||||
--color-primary: #3B82F6;
|
||||
--color-danger: #FF6B6B;
|
||||
--color-success: #07C160;
|
||||
--color-warning: #FAAD14;
|
||||
}
|
||||
Reference in New Issue
Block a user