Action links render in the wrong colour in dark mode
维护者通常 1 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 88/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- react, scss, typescript
调研方向
从 frontend/web/styles/styles.scss 第 88 行附近开始,这里是 body.dark a 规则所在的位置,并将它与 .text-action 类(在 frontend/web/styles/_token-utilities.scss 中生成)进行比较。在 body.dark 块内添加更具体的 a.text-action 规则,然后修复 frontend/web/components/pages/CreateOrganisationPage.tsx 第 149-151 行附近的 View Docs 锚点,方法是添加 ms-1 并删除无效的 {' '}。完成的状态应该是:链接在深色模式下保持紫色,并且在两种主题下都有可见的间隙;需在 Create Organisation 页面上检查,并用列出的其他 .text-action 锚点做抽查。
由索引模型根据 Issue 内容生成。
描述
How are you running Flagsmith
- SaaS at flagsmith.com
Describe the bug
Links that use the text-action utility render in the default dark-mode anchor colour instead of the action purple.
The clearest example is the View Docs link on the Create Organisation page, next to "What is your company's desired hosting option?". In light mode the link is purple. In dark mode it is light grey, almost the same colour as the label text, so it no longer reads as a link.
The same link also has no gap after the question mark, so the line renders as "option?View Docs". That second defect appears in both themes.
Steps To Reproduce
- Open
https://app.flagsmith.com/createwith the light theme. The View Docs link is purple. - Switch the theme to dark mode.
- The same link is now light grey, close to the label colour. No gap separates it from the question mark in either theme.
Expected behavior
An action link keeps the purple action colour in both themes, and a space separates it from the text before it.
Root cause
frontend/web/styles/styles.scss:88 contains a legacy anchor rule.
body.dark {
background-color: $bg-dark500;
a {
color: $anchor-color-dark;
}
}
body.dark a is more specific than the single .text-action class generated in frontend/web/styles/_token-utilities.scss, so the --color-text-action token never applies to an anchor in dark mode. $anchor-color-dark resolves to slate-200, a light grey that is close to the default text colour on a dark surface.
Spans with the same class are unaffected, which is why only links look wrong. Other .text-action anchors in the app have the same defect in dark mode.
web/components/Breadcrumb.tsx:19web/components/pages/OnboardingPage.tsx:123web/components/pages/OnboardingPage.tsx:132web/components/pages/MetricsPage.tsx:249web/components/EnvironmentDocumentCodeHelp.tsx:60web/components/modals/CreateAuditLogWebhook.tsx:107web/components/modals/CreateWebhook.tsx:105web/components/modals/payment/Payment.tsx:142web/components/modals/payment/Payment.tsx:151web/components/pages/CreateOrganisationPage.tsx:151
The missing gap has a separate cause. FieldLabel renders a flex row through d-flex align-items-center, so a whitespace text node between the label text and the anchor collapses at the flex item edge. The {' '} on CreateOrganisationPage.tsx:149 has no effect.
Suggested fix
Add one rule inside the body.dark block, after the a rule.
body.dark {
background-color: $bg-dark500;
a {
color: $anchor-color-dark;
}
a.text-action {
color: var(--color-text-action);
}
}
The new rule compiles to body.dark a.text-action, which is more specific than body.dark a, so it restores the token colour for every action link in dark mode. A bare a.text-action would not be enough, because it has fewer type selectors than body.dark a.
Then give the View Docs anchor ms-1 and remove the dead {' '} for the gap.
Screenshots
Light and dark mode screenshots of the View Docs link on the Create Organisation page are attached below.
- 主要语言
- Python
- 星标
- 7.4k
- 派生
- 613
- 平均合并
- 1 天 11 小时
- 30 天内合并 PR
- 144
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Flagsmith/flagsmith 的其他 Issue
-
Fix Button Alignment in SDK Installation Section可能已有人在做 @manueldezman 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 62/100
Flagsmith/flagsmith#9056 · 2 条评论 ·
维护者通常 1 天内回复
-
Cloud Python warehouse snippet omits the import needed by its short-lived-job guidance可能已有人在做 @jcd1991 于 1 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 75/100
Flagsmith/flagsmith#9045 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 83/100
Flagsmith/flagsmith#9013 · 1 条评论 ·
维护者通常 1 天内回复
-
Expose whether an organisation is blocked for API usage可能已有人在做 @PiUnknown 于 35 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 62/100
Flagsmith/flagsmith#8773 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
查看 Flagsmith/flagsmith 的全部 Issue
相似的 Issue
-
flaky: test_fire_returns_thread_per_http_entry_on_head waits 5 s per dispatch worker on busy shards未关闭status/accepted type/bug
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
bug vector-store
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
EverMind-AI/Raven#1413 ·
维护者通常 1 天内回复
-
Tests: parallel pyinstallcheck runs oversubscribe the machine through nested TBB and BLAS pools可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 86/100
ACCESS-NRI/containerised-environments-infra#143 ·
维护者通常 2 天内回复