Skip to content

Dark palette scales are non-monotonic: step 6 duplicates step 3 #5282

Description

@pomfrida

Found during the Chip dark-mode comparison (#5225) and first documented in a comment on #5221. Still present in the latest Tokens Studio release (pulled in #5280), so filing it separately now that #5221 is being closed.

Problem

In every dark scale, step 6 is byte-identical to step 3, and step 4 is lighter than step 6 — the lightness ladder is non-monotonic. From the CSS export in #5280:

--eds-dark-north-sea-3: oklch(0.47 0.0187 242.96);
--eds-dark-north-sea-4: oklch(0.52 0.0242 242.96);
--eds-dark-north-sea-5: oklch(0.58 0.0303 242.96);
--eds-dark-north-sea-6: oklch(0.47 0.0187 242.96); /* == step 3 */
--eds-dark-north-sea-7: oklch(0.61 0.0328 242.96);

Same duplicate in dark-blue, dark-moss-green and dark-red (3 == 6 in all of them). The light scales are monotonic in the current export.

Related observation from the same finding: step 2 in dark (L 0.226) is nearly the canvas value (step 1 = L 0.19), so subtle/muted fills on step 2 are almost invisible against the dark canvas. In light the step 1 vs 2 difference is equally small but reads fine; in dark it is the difference between a visible fill and a ghost. See the dark-mode comparison comment on #5225 for measured values and screenshots.

Impact

  • Any state ladder that steps 4 → 6 in dark inverts: pressed renders darker than hover and identical to step 3 (Button secondary/ghost currently consumes accent-4/accent-6 directly for hover/pressed).
  • border.neutral.strong = {neutral.6} renders the same as step 3 in dark.
  • The background.interactive.*.muted ladders (steps 1–4) sit almost on the canvas at their default step in dark.

Likely cause

The raw scheme sets define each step as a formula: set_chroma(set_lightness({input.palette.<scale>.anchor}, {input.scale.dark.<N>}), {foundation.gaussian.dark.<N>} * …). Since both L and C are identical between steps 3 and 6 across all scales, {input.scale.dark.6} (and the matching gaussian input) most likely holds the wrong value. The fix belongs on the Tokens Studio side (input scale sets), followed by a new release and studio tokens pull.

Relates to #4742 / parent epic #4740.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions