feat(ui): 全项目暗黑模式适配 — 加 theme 变量 + 替换全部硬编码颜色

新增主题变量 (light + dark 两套):
- --success-rgb / --danger / --danger-rgb (utils/theme.js)

全部硬编码 #XXX / rgba 颜色统一改主题变量:
- progress-ring 加 trackColor prop,默认 #EEEEEE
  (canvas 不能直接读 CSS var,需要 caller 传字面颜色)
- ui-modal sheet 背景 #FFFFFF → var(--card-bg), 加底部 padding 避开 Dock TabBar
- ui-modal handle #DDD → var(--bg-soft)
- ui-btn --danger 文字 #E53935 → var(--danger), 边框 rgba(229,57,53,...) → rgba(var(--danger-rgb),...)
- calendar-heatmap 三个 #999/#333 文字色 → var(--text-secondary)/var(--text)
- index picker: preset/custom input 背景 #F5F5F5 → var(--bg-soft), label #666 → var(--text-secondary)
- index done-badge 绿色 → var(--success-rgb), pending-text #CCC → var(--text-secondary)
- records empty/hint #CCC/#E0E0E0 → var(--text-secondary), danger 红 → var(--danger)
- settings plan-editor-sheet 背景 #FFFFFF → var(--card-bg), avatar 背景, handle, editor-input, preview 全部跟进
- leaderboard 金/铜背景 #FFF7E6/#FFF1E6 → rgba 半透明 (dark mode 下不刺眼)

Tab bar inactive 图标重新根据 dark mode 切换颜色 (#999999 light / #98989F dark)

leaderboard.json 删除 backgroundColor: #F5F5F5 覆盖,让 theme.json 接管

故意保留:
- 各 .wxss 中渐变按钮上的 #FFFFFF 文字色
- 排行榜金/铜文字色 #FA8C16/#D46B08 (视觉符号约定)
- 各页 data 中 orange theme 默认值 (onShow 后被 themeMod 覆盖)
This commit is contained in:
2026-07-08 15:22:09 +08:00
parent 326bc013fe
commit ac0db6118d
11 changed files with 73 additions and 64 deletions
+12 -12
View File
@@ -90,7 +90,7 @@
.plan-radio {
width: 40rpx;
height: 40rpx;
border: 3rpx solid #DDD;
border: 3rpx solid var(--border);
border-radius: 50%;
display: flex;
align-items: center;
@@ -240,7 +240,7 @@
height: 120rpx;
padding: 0;
margin: 0;
background: #F5F5F5;
background: var(--bg-soft);
border-radius: 50%;
border: none;
line-height: 1;
@@ -257,7 +257,7 @@
height: 100%;
border-radius: 50%;
/* peopleFill svg is mostly transparent; give it a soft tint */
background: #EEE;
background: var(--bg-soft);
padding: 24rpx;
box-sizing: border-box;
}
@@ -319,7 +319,7 @@
.about-copy {
font-size: 22rpx;
color: #CCCCCC;
color: var(--text-secondary);
}
/* ---- plan editor modal ---- */
@@ -347,7 +347,7 @@
max-height: 88vh;
overflow-y: auto;
box-sizing: border-box;
background: #FFFFFF;
background: var(--card-bg);
border-radius: 32rpx 32rpx 0 0;
padding: 12rpx 32rpx 40rpx;
/* Sheet is z-index 1000 above the tab bar (z-index 999), but the tab bar
@@ -361,7 +361,7 @@
.plan-editor-handle {
width: 64rpx;
height: 8rpx;
background: #DDD;
background: var(--bg-soft);
border-radius: 4rpx;
margin: 0 auto 16rpx;
}
@@ -409,7 +409,7 @@
.editor-input {
height: 68rpx;
background: #F5F5F5;
background: var(--bg-soft);
border-radius: 10rpx;
padding: 0 16rpx;
font-size: 26rpx;
@@ -420,7 +420,7 @@
.editor-preview {
margin-top: 6rpx;
background: #FAFAFA;
background: var(--bg);
border-radius: 14rpx;
padding: 12rpx 16rpx;
}
@@ -453,7 +453,7 @@
justify-content: space-between;
align-items: center;
padding: 8rpx 0;
border-bottom: 1rpx solid #EEE;
border-bottom: 1rpx solid var(--border);
font-size: 24rpx;
}
@@ -498,13 +498,13 @@
}
.editor-action-reset {
background: #FFFFFF;
background: var(--card-bg);
color: var(--text-secondary);
border: 2rpx solid var(--border);
}
.editor-action-reset:active {
background: #F5F5F5;
background: var(--bg-soft);
}
.editor-action-save {
@@ -575,6 +575,6 @@
}
.confirm-btn--danger {
background: #E53935;
background: var(--danger);
color: #FFFFFF;
}