Goal. Status text on a tinted status surface is readable, and passes WCAG AA.
Problem. The semantic pairs fail. Measured in light mode:
| Pair |
Ratio |
AA body text needs 4.5:1 |
text-warning on surface-warning |
1.93:1 |
fails |
text-success on surface-success |
2.64:1 |
fails |
text-danger on surface-danger |
3.25:1 |
fails, passes large text only |
It is not only the pairing. text-warning is 2.04:1 on plain white, so it fails as body text on any light background.
Already shipping with these pairs: experiments/StatusBadge, MetricsComparisonTable, WizardStepper, WarehouseSetup, SetupStep.
Why the surface cannot be the fix. The surfaces are 8% tints, so they are nearly white already. Even against pure white all three fail. Fixing via surfaces means inverting to dark surfaces with light text, which is a redesign rather than a token change.
Scope
- darker text values for the three statuses. These clear 4.5:1 on their own tint: warning
#b45800, danger #dc141f, success #1c7d6d
- leave
border-* and icon-* at the brand colours. Non-text contrast only needs 3:1, so the brand orange, teal and red survive wherever they are decorative
- measure and set dark mode separately. The text tokens are currently identical in both themes while the surfaces are not, so darkening globally would make dark mode worse
- a comment in the token file saying why text and border diverge, or someone will tidy them back together
Done when
- all three pairs clear 4.5:1 in both themes
- the five components above are checked against the new values
- large display numbers still read as intended, since they only need 3:1 and will now be darker
Goal. Status text on a tinted status surface is readable, and passes WCAG AA.
Problem. The semantic pairs fail. Measured in light mode:
text-warningonsurface-warningtext-successonsurface-successtext-dangeronsurface-dangerIt is not only the pairing.
text-warningis 2.04:1 on plain white, so it fails as body text on any light background.Already shipping with these pairs:
experiments/StatusBadge,MetricsComparisonTable,WizardStepper,WarehouseSetup,SetupStep.Why the surface cannot be the fix. The surfaces are 8% tints, so they are nearly white already. Even against pure white all three fail. Fixing via surfaces means inverting to dark surfaces with light text, which is a redesign rather than a token change.
Scope
#b45800, danger#dc141f, success#1c7d6dborder-*andicon-*at the brand colours. Non-text contrast only needs 3:1, so the brand orange, teal and red survive wherever they are decorativeDone when