Skip to content

fix(setting): StatsPage 暗色模式样式适配#15

Closed
Lyn6969 wants to merge 1 commit into
huanfeng:mainfrom
Lyn6969:fix/stats-page-dark-mode
Closed

fix(setting): StatsPage 暗色模式样式适配#15
Lyn6969 wants to merge 1 commit into
huanfeng:mainfrom
Lyn6969:fix/stats-page-dark-mode

Conversation

@Lyn6969

@Lyn6969 Lyn6969 commented May 25, 2026

Copy link
Copy Markdown

问题

StatsPage(统计页面)在暗色主题下显示异常:数字卡片、热力图、条形图等组件使用了未定义的 CSS 变量(如 --text-primary--card-bg--border-color 等),浏览器只能回退到硬编码的浅色 fallback 值,导致暗色模式下出现白底白字、对比度错乱等问题。

修改

  • 新增 .section 作用域下的 --stats-* 系列 CSS 变量,映射到项目标准的 --foreground--muted-foreground--card--border--secondary 等主题变量
  • 全面替换 StatsPage 中所有旧的幽灵变量/硬编码颜色引用
  • 统一热力图单元格边框为 hsl(var(--border) / 0.65)

验证

  • 本地 wails dev 启动后,在暗色/亮色主题下切换,统计页面各组件颜色正常跟随主题变化

将 StatsPage 中未定义的 CSS 变量(--text-primary / --text-secondary 等)
替换为项目标准的主题变量(--foreground / --muted-foreground / --card / --border 等),
解决暗色主题下数字卡片、热力图、条形图等组件颜色异常的问题。
Copilot AI review requested due to automatic review settings May 25, 2026 08:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR updates the Stats page styling to align with the app’s design tokens by introducing component-scoped CSS variables and replacing prior ad-hoc/fallback colors.

Changes:

  • Added --stats-* CSS variables for text/surface/card colors.
  • Replaced previous --text-*, --card-bg, --border-color, and --bg-secondary usages with the new variables.
  • Added a subtle shadow to .stat-card and adjusted some borders/backgrounds to use --border/--secondary tokens.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +730 to +737
.section {
--stats-text-primary: hsl(var(--foreground));
--stats-text-secondary: hsl(var(--muted-foreground));
--stats-text-tertiary: hsl(var(--muted-foreground) / 0.82);
--stats-card-bg: hsl(var(--card));
--stats-card-border: hsl(var(--border));
--stats-surface-soft: hsl(var(--secondary));
--stats-surface-muted: hsl(var(--secondary) / 0.72);
Comment on lines +755 to +756
background: var(--stats-card-bg);
border: 1px solid var(--stats-card-border);
border-radius: 8px;
padding: 16px;
text-align: center;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
Comment on lines 910 to 921
.hour-label {
font-size: 10px;
color: var(--text-secondary);
color: var(--stats-text-secondary);
width: calc(100% / 8);
text-align: left;
}

.hour-label {
font-size: 10px;
color: var(--text-secondary);
color: var(--stats-text-secondary);
margin-top: 2px;
}
@Lyn6969 Lyn6969 closed this May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants