Skip to content

Dark mode high-contrast chip: text-on-emphasis / emphasis-default token pairing falls below Lc 75 (APCA) #5335

Description

@millus

Found during the APCA verification pass for #5225 on beta.6.

What's wrong

High-contrast chip in dark mode uses:

  • Background: --eds-background-interactive-{tone}-emphasis-default = shade 9 → oklch(0.82 …) for all tones in dark
  • Text/icon: --eds-text-on-emphasis / --eds-icon-on-emphasis = --eds-neutral-15oklch(0.10 …) in dark (near-black)

That pairing gives these APCA Lc values in dark mode:

Tone Lc vs Lc 75
danger 69.4 ⚠️
warning 71.7 ⚠️
info 74.0 ⚠️
neutral 73.5 ⚠️
accent 74.5 ⚠️
success 75.6

Light mode passes comfortably (Lc 80+ for all tones, all chips verified in #5225).

Root cause

The soft-clamp in APCA raises the effective luminance of near-black text (oklch(0.10), Y ≈ 0.001) when the background is not pure white. The emphasis background at shade 9 (L 0.82, Y ≈ 0.55) is light but not extreme, and the near-black text cannot overcome the normalisation to hit Lc 75 cleanly for the more chromatic (warning/danger) fills.

Fix needed in Tokens Studio

Chip correctly uses the semantic tokens as designed — this is not a chip.css issue. The fix must come at the token level. Two options:

  1. Move emphasis-default to a darker shade in dark mode — e.g. shade 10 (L 0.88) instead of shade 9 (L 0.82) would bring warning closer to Lc 75 and improve danger.
  2. Adjust text-on-emphasis in dark — currently neutral-15 (L 0.10, Y ≈ 0.001). A slightly lighter value would help due to the APCA soft-clamp, but design intent may be true-black.

A design measurement pass on the emphasis/on-emphasis pairing per tone in dark mode would clarify which option keeps the intended visual weight.

Related

Metadata

Metadata

Labels

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions