Theme: move hard-coded colours into tokens, prepare a light or high-contrast variant
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start with Theme/Tokens.axaml and Theme/Styles.axaml, then use the file counts and colour values in the issue to locate hard-coded colours across the listed views. Compare each value with existing tokens and move the colours into tokens while preserving their rendered values. Check that views use the appropriate resources and compare before and after renders for pixel identity; the issue says the light or high-contrast variant and setting are separate steps.
由索引模型根据 Issue 内容生成。
描述
Split out of #605, whose wording half shipped on its own (#678, #679).
Problem
App.axaml:5hard-locksRequestedThemeVariant="Dark".Theme/Tokens.axamlis one flatResourceDictionarywith noThemeDictionaries: 25Colors and 26 brushes.- Views hard-code hex colours instead of using the tokens.
Direct sun or glare in a vehicle calls for a light or high-contrast variant. Today that is not possible without touching every view.
Survey (main at 95a6845)
There are 114 hard-coded colour values in .axaml outside Tokens.axaml. That count excludes #123 issue references in comments.
| File | Count |
|---|---|
Theme/Styles.axaml |
39 |
Views/CoMessprotokollView.axaml |
15 |
Views/MasterDataEditorView.axaml |
12 |
Views/EtbView.axaml |
7 |
Views/RolesView.axaml |
6 |
Views/TasksView.axaml, Views/ForcesView.axaml |
4 each |
ScbaView, HomeView, FilesView |
3 each |
| 12 more views | 1–2 each |
The most common values:
| Value | Uses | Token with the same value? |
|---|---|---|
#0F141D |
25 | none (closest: AppBgColor2 #10141C) |
#0C1119 |
25 | none |
#241608 |
10 | AmberWashColor |
#F87171 |
8 | ErrorColor |
#FFFFFF |
7 | none |
#B3070A10 |
7 | none (scrim) |
#2A1013 |
3 | ErrorWashColor |
#FF0000, #92D050, #FFC000 |
3 / 3 / 1 | none (CO-Messprotokoll status colours) |
C# has hex colours only for the CO-Messprotokoll:
CoMessprotokollViewModel.csuses the status colours as string literals.Documents/Sections/CoMessprotokollSection.csduplicates the Amber, SignalHot and Signal tokens for the PDF. The PDF is not themed, so that part can stay.
Plan
- Tokens first, no visual change. Move every hard-coded colour into
Tokens.axaml, reusing the existing token where the value matches. Give#0F141D/#0C1119(panel and grid backgrounds) and the scrim their own tokens. A before/after render of every view should be pixel-identical. ThemeDictionaries. Move the tokens underDark, and switch views fromStaticResourcetoDynamicResourcewhere a variant has to swap at runtime.- A light or high-contrast variant, plus a setting to pick it. This needs a palette decision, ideally checked in a vehicle in daylight.
Each step can be its own PR.
- 主要语言
- C#
- 星标
- 1
- 派生
- 3
- 平均合并
- 4 小时 15 分钟
- 30 天内合并 PR
- 181
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
CodeForFire/lagebuch 的其他 Issue
-
Stammdaten: in the Checkliste editor the PFLICHT header is not aligned with its column可能已有人在做 @Saad-elnagar 于 2 天前认领。 未关闭bug ux
难度 2/5 1-3 小时 新手友好度 78/100
CodeForFire/lagebuch#714 · 1 条评论 ·
维护者通常 1 天内回复
-
Stammdaten: on a phone the Fahrzeuge editor squeezes Wache and Funkrufname to nothing可能已有人在做 @Saad-elnagar 于 2 天前认领。 未关闭bug ux
难度 2/5 1-3 小时 新手友好度 75/100
CodeForFire/lagebuch#713 · 1 条评论 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 62/100
CodeForFire/lagebuch#405 ·
维护者通常 1 天内回复
-
documentation good first issue
难度 2/5 1-3 小时 新手友好度 88/100
CodeForFire/lagebuch#349 ·
维护者通常 1 天内回复
-
documentation good first issue
难度 2/5 1-3 小时 新手友好度 88/100
CodeForFire/lagebuch#348 ·
维护者通常 1 天内回复
查看 CodeForFire/lagebuch 的全部 Issue
相似的 Issue
-
alerts bug effort:S P2
难度 2/5 1-3 小时 新手友好度 76/100
nightscout/nocturne#2511 ·
维护者通常 1 天内回复
-
feature-request
难度 2/5 1-3 小时 新手友好度 77/100
stripe/stripe-dotnet#3484 ·
维护者通常 2 天内回复
-
bug mcp misleading small
难度 2/5 1-3 小时 新手友好度 77/100
维护者通常 1 天内回复
-
accessibility help wanted macos
难度 2/5 1-3 小时 新手友好度 70/100
dorlugasigal/annotator#42 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
AvaloniaUI/Avalonia#22568 ·
维护者通常 2 天内回复