Aitema-gmbh commented on code in PR #39234:
URL: https://github.com/apache/superset/pull/39234#discussion_r3234040937
##########
superset-frontend/packages/superset-core/src/theme/GlobalStyles.tsx:
##########
@@ -55,6 +55,19 @@ export const GlobalStyles = () => {
color: ${theme.colorLink};
}
+ /* WCAG 1.4.3: Minimum Contrast — route link colors through theme
tokens
+ so they adapt to light, dark, and custom themes. The token defaults
+ (colorLink / colorLinkHover) are tuned to meet the 4.5:1 contrast
+ threshold on the paired colorBgBase; hardcoded hex values previously
+ used here were light-mode-only and failed WCAG in dark themes.
+ Excludes links that are intentionally styled as buttons. */
+ a:not([class*="ant-btn"]):not([role="button"]) {
+ color: ${theme.colorLink};
+ }
+ a:not([class*="ant-btn"]):not([role="button"]):hover {
+ color: ${theme.colorLinkHover};
+ }
Review Comment:
Addressed in `e642f478` — added an `ensureLinkContrast` helper (tinycolor2)
and apply it after the AntD token pass in `Theme.setConfig`. When the caller
supplies neither `colorPrimary` nor `colorLink`, the default link tokens
(`#1677ff` ~4.32:1 on white) are darkened in 4% HSL-lightness steps until they
meet WCAG 1.4.3's 4.5:1. Two new Theme tests pin this: one asserts the
default-config link tokens all clear 4.5:1, the other asserts that an explicit
brand `colorPrimary` is left untouched (the sanitizer scope is the default
Superset theme, not operator-customized themes). Resolving — thanks for the
catch.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]