Action links render in the wrong colour in dark mode
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 88/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- react, scss, typescript
Direzione di ricerca
Inizia in frontend/web/styles/styles.scss intorno alla riga 88, dove si trova la regola body.dark a, e confrontala con la classe .text-action generata in frontend/web/styles/_token-utilities.scss. Aggiungi la regola più specifica a.text-action dentro il blocco body.dark, poi correggi l'ancora View Docs in frontend/web/components/pages/CreateOrganisationPage.tsx intorno alle righe 149-151 aggiungendo ms-1 e rimuovendo il {' '} morto. Il risultato finale è che il link resta viola in modalità scura e c'è uno spazio visibile in entrambi i temi, verificato nella pagina Create Organisation e controllato a campione rispetto alle altre ancore .text-action elencate.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 7.4k
- Fork
- 613
- Merge medio
- 1g 11h
- PR unite (30g)
- 144
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Flagsmith/flagsmith
-
Fix Button Alignment in SDK Installation SectionForse già presa @manueldezman l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
Flagsmith/flagsmith#9056 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Cloud Python warehouse snippet omits the import needed by its short-lived-job guidanceForse già presa @jcd1991 l’ha presa 1 giorno fa. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
Flagsmith/flagsmith#9045 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 83/100
Flagsmith/flagsmith#9013 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Expose whether an organisation is blocked for API usageForse già presa @PiUnknown l’ha presa 35 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
Flagsmith/flagsmith#8773 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Flagsmith/flagsmith
Issue simili
-
flaky: test_fire_returns_thread_per_http_entry_on_head waits 5 s per dispatch worker on busy shardsApertastatus/accepted type/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
microsoft/apm#5309 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug vector-store
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
EverMind-AI/Raven#1413 ·
I maintainer di solito rispondono entro 1 giorno
-
Tests: parallel pyinstallcheck runs oversubscribe the machine through nested TBB and BLAS poolsForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
ACCESS-NRI/containerised-environments-infra#143 ·
I maintainer di solito rispondono entro 2 giorni