Action links render in the wrong colour in dark mode

Abierto Apto para principiantes
#9,082 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@manueldezman ya está trabajando en esto.

Desde el 23/11/2026.

  • #9083 de @manueldezman — abierto

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
88/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
react, scss, typescript
Área
design, frontend

Línea de trabajo

Empieza en frontend/web/styles/styles.scss alrededor de la línea 88, donde vive la regla body.dark a, y compárala con la clase .text-action generada en frontend/web/styles/_token-utilities.scss. Añade la regla más específica a.text-action dentro del bloque body.dark, luego corrige el ancla View Docs en frontend/web/components/pages/CreateOrganisationPage.tsx alrededor de las líneas 149-151 añadiendo ms-1 y eliminando el {' '} muerto. Queda listo cuando el enlace permanece morado en modo oscuro y hay un espacio visible en ambos temas, comprobado en la página Create Organisation y verificado por muestreo con las otras anclas .text-action listadas.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Python
Estrellas
7.4k
Forks
613
Merge medio
1 d 11 h
PR fusionados (30 d)
144

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Flagsmith/flagsmith

Todos los issues de Flagsmith/flagsmith

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.