codeant-ai-for-open-source[bot] commented on code in PR #39234:
URL: https://github.com/apache/superset/pull/39234#discussion_r4335233689
##########
superset-frontend/packages/superset-core/src/theme/Theme.tsx:
##########
@@ -124,6 +161,30 @@ export class Theme {
// First phase: Let Ant Design compute the tokens
const tokens = Theme.getFilteredAntdTheme(antdConfig);
+ // WCAG 1.4.3: when the caller supplies no brand color at all, Ant Design's
+ // own default `colorLink = #1677ff` sits at ~4.32:1 against white — below
+ // the 4.5:1 normal-text threshold. Nudge the link tokens into compliance
+ // only in that "neither colorPrimary nor colorLink was supplied" path, so
+ // explicit brand colors keep the exact value the caller picked.
Deployments
+ // that intentionally pass a low-contrast brand colorPrimary keep their
+ // brand fidelity; the WCAG guarantee here applies to the *default*
Superset
+ // theme rather than to operator-customized themes.
+ const callerSetLinkOrPrimary =
+ !!(config as AnyThemeConfig)?.token?.colorLink ||
+ !!(config as AnyThemeConfig)?.token?.colorPrimary;
+ if (!callerSetLinkOrPrimary) {
Review Comment:
✅ **CodeAnt verified this suggestion was addressed in subsequent commits and
marked this thread resolved** as of `9d29069`.
The contrast gate now checks `colorLink` and `colorPrimary` on the caller’s
`config`, rather than on the merged config, so inherited base-theme defaults do
not suppress sanitization.
<sub>If that's not right, unresolve this thread and CodeAnt will leave it
open.</sub>
<!-- codeant-auto-resolve-reply -->
--
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]