Site dark mode: IMPORTANT callouts render as light text on a white box
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 88/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- css
- 领域
- frontend
调研方向
从src/site/resources/css/site.css开始,将其中的备用颜色变量与 issue 中显示的深色模式 IMPORTANT callout 规则进行比较。添加其中描述的针对性body.dark .callout.callout-important覆盖规则,然后验证深色模式下 IMPORTANT callout 的文字和背景颜色是否清晰易读。
由索引模型根据 Issue 内容生成。
描述
Where: src/site/resources/css/site.css (MetricsHub colors), with Sentry Maven Skin 8.
What happens: in dark mode, an > [!IMPORTANT] callout renders as a white box with light text, which is unreadable.
The skin styles IMPORTANT callouts with the alternate colors, and swaps them in dark mode (published css/main-combined.css):
.callout.callout-important { --callout-bg: var(--alternate-bgcolor); --callout-fg: var(--alternate-fgcolor); }
body.dark .callout.callout-important { --callout-bg: var(--alternate-fgcolor); --callout-fg: var(--alternate-bgcolor); }
Our site.css sets --alternate-bgcolor: #266fd0 and --alternate-fgcolor: #fff and does not override them in body.dark, so in dark mode the callout background becomes #fff. The callout's body text keeps the dark-mode foreground (#e9ecef), so it is light text on white.
Impact today: none of the current pages uses an IMPORTANT callout, so the bug is latent. It shows up as soon as a page adds one. It was found in ipmi-java, which copied this site.css (MetricsHub/ipmi-java#113).
Suggested fix: the fix applied in ipmi-java, appended to site.css:
/* The skin inverts the alternate colors for IMPORTANT callouts in dark mode, which turns our white-on-blue
palette into a white box with light text */
body.dark .callout.callout-important {
--callout-bg: var(--main-bgcolor);
--callout-fg: var(--link-color);
}
Overriding --alternate-fgcolor in body.dark instead would also darken the text that the skin draws on the blue alternate background (active menu item, ...), so the targeted rule is safer. The other MetricsHub projects that share this site.css probably have the same latent bug. The skin's dark rule could arguably handle a light --alternate-fgcolor itself.
- 主要语言
- Java
- 星标
- 13
- 派生
- 4
- 平均合并
- 11 小时 58 分钟
- 30 天内合并 PR
- 20
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
MetricsHub/winrm-java 的其他 Issue
-
bug
难度 3/5 1-2 天 新手友好度 78/100
MetricsHub/winrm-java#199 ·
维护者通常 1 天内回复
-
enhancement
难度 5/5 一周以上 新手友好度 30/100
MetricsHub/winrm-java#194 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 38/100
MetricsHub/winrm-java#176 ·
维护者通常 1 天内回复
查看 MetricsHub/winrm-java 的全部 Issue
相似的 Issue
-
Use GHA setup gradle action可能已有人在做 @bric3 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 67/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
openhab/openhab-addons#21921 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 62/100
jellyfin/jellyfin-androidtv#5885 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
priority:P2 product:orazaka type:bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复