Action links render in the wrong colour in dark mode

未关闭 适合新手
#9,082 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@manueldezman 已经在做这个了。

开始于 2026年11月23日。

  • #9083 来自 @manueldezman —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
88/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
react, scss, typescript
领域
design, frontend

调研方向

从 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

  1. Open https://app.flagsmith.com/create with the light theme. The View Docs link is purple.
  2. Switch the theme to dark mode.
  3. 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:19
  • web/components/pages/OnboardingPage.tsx:123
  • web/components/pages/OnboardingPage.tsx:132
  • web/components/pages/MetricsPage.tsx:249
  • web/components/EnvironmentDocumentCodeHelp.tsx:60
  • web/components/modals/CreateAuditLogWebhook.tsx:107
  • web/components/modals/CreateWebhook.tsx:105
  • web/components/modals/payment/Payment.tsx:142
  • web/components/modals/payment/Payment.tsx:151
  • web/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

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Flagsmith/flagsmith 的其他 Issue

查看 Flagsmith/flagsmith 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。