Commit 9cb1d71
Charts: align --wpds-* fallback values with the design system [CHARTS-254] (#51452)
* Charts: align WPDS fallback values with the design system
Six `--wpds-*` fallbacks across fifteen call sites carried values the
design system had moved on from. A fallback is what actually renders
whenever the token is unset, and for typography that is the normal case
rather than a corner: WordPress defines no `--wpds-typography-*` at all,
so in wp-admin the hand-written value is the one on screen.
--wpds-typography-font-weight-emphasis 499 → 600
--wpds-typography-font-size-lg 16px → 15px
--wpds-typography-font-size-xl 18px → 20px
--wpds-typography-font-family-body sans-serif → the full stack
Two more were not stale so much as flattened. The spec fallback for
`--wpds-color-background-interactive-brand-strong` and
`--wpds-color-stroke-interactive-brand` is itself a chain,
`var(--wp-admin-theme-color, #3858e9)`, and writing only the hex pinned
the zoom selection to WordPress blue instead of letting it follow the
admin colour scheme.
`wpds-fallbacks.test.ts` is what stops this recurring: it reads every
`--wpds-*` reference under `src` and asks the installed
`@wordpress/theme` what each one is worth, so a value that drifts — or a
stylesheet reference left bare, which renders as nothing — fails with
the value it should have had.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EK9Kr5FFd4tGPD7QWLvKsn
* Charts: explain why fallbacks are hand-written here
"Fallbacks must match the WPDS spec value" reads like an oversight in
2026 — `@wordpress/theme` ships plugins that inject them and
`@wordpress/build` auto-loads them, so a reader who knows that will
reasonably try to delete the fallbacks and reference tokens bare.
Doing so breaks this package. `dist/` is built by tsdown, which loads no
such plugin, and webpack consumers never read `dist/` at all — they
resolve the SCSS through the `jetpack:src` export condition and compile
it themselves. Record that, and point at the test that reports the value
the design system expects, so the rule is followable rather than a thing
to be looked up token by token.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EK9Kr5FFd4tGPD7QWLvKsn
* Charts: changelog
Entries for the package and for every plugin that puts a chart in front
of a user. The typography correction is not theoretical for them: nothing
WordPress ships defines `--wpds-typography-*`, so in wp-admin the
injected fallback is the value that actually renders.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EK9Kr5FFd4tGPD7QWLvKsn
* Address review: resolve each token's spec value once (comment #5363666120)
The drift check asked the design system for the same token twice on a
failing reference — once to decide it had drifted, once to build the
message. Resolve it into the reference first, then compare, so the value
that fails the assertion is the one that was tested against.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EK9Kr5FFd4tGPD7QWLvKsn
* Address review: stop restating token values in prose (comment #5364772095)
The semi-circle chart's docs page named the label's font size and weight
as "(default 16px)" and "(default 499)" — the two values corrected two
files over, and the only place `499` still reached a screen. It is
published to Storybook, so the documented defaults contradicted the
shipped ones.
Drop the values rather than update them. `wpds-fallbacks.test.ts` reads
`var()` calls, so a number written in prose is a number nothing keeps
honest; restating spec values by hand is the failure this branch exists
to remove, and doing it in a docs page is the same failure with no test
behind it. The tokens are still named, so a reader has somewhere to look.
Also from that review:
- `specFallback` sliced off a `var(<token>, ` prefix it assumed was
there. It is there only because the upstream plugin throws on an
unknown token — an internal of a package this repo does not control.
Check the prefix and fail naming the token, so a plugin that stops
throwing cannot feed a fragment of the token name into some later
assertion.
- The scan skipped test directories with `includes( '/test/' )`. Paths
are relative to `src`, so a future `src/test/` would arrive as
`test/foo.ts` and be audited as source.
- The zoom-selection changelog entry was indicative and lowercase.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EK9Kr5FFd4tGPD7QWLvKsn
* Charts: fold the two changelog entries into one
Both described the same fix from different angles — fallback values that
had drifted from the design system — so splitting them across a `fixed`
and a `changed` entry read as two unrelated changes in the release notes.
The zoom selection's flattened chain was a drift correction as much as
the font weights were.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EK9Kr5FFd4tGPD7QWLvKsn
* Charts: keep the test out of the published docs
The semi-circle chart's docs page explained why it no longer restates
the token values, and named the test that would not have caught them.
That is a note to whoever edits the page, written on the page itself:
readers of the published Storybook are chart consumers, and no other
story doc in the package refers to a test file.
Say what the reader wants — the tokens resolve to the design system's
values — and leave the reasoning in AGENTS.md, where it is aimed at the
person who might otherwise write a number back in.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EK9Kr5FFd4tGPD7QWLvKsn
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/32800481068
Upstream-Ref: Automattic/jetpack@26ff7201 parent 2de84ac commit 9cb1d71
7 files changed
Lines changed: 10 additions & 10 deletions
File tree
- jetpack_vendor/automattic
- jetpack-podcast/build/routes/dashboard
- vendor/composer
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | 15 | | |
17 | 16 | | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | 16 | | |
18 | 17 | | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | 33 | | |
38 | 34 | | |
39 | 35 | | |
| |||
42 | 38 | | |
43 | 39 | | |
44 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
0 commit comments