Skip to content

Forms: forward-compatible WPDS color token fallbacks for @wordpress/theme 0.16 - #50082

Closed
CGastrell wants to merge 2 commits into
trunkfrom
update/forms-wpds-color-token-fallbacks
Closed

Forms: forward-compatible WPDS color token fallbacks for @wordpress/theme 0.16#50082
CGastrell wants to merge 2 commits into
trunkfrom
update/forms-wpds-color-token-fallbacks

Conversation

@CGastrell

Copy link
Copy Markdown
Contributor

Proposed changes

The Forms dashboard SCSS references the WPDS color tokens by their pre-0.16 names (--wpds-color-bg-* / --wpds-color-fg-*). @wordpress/theme 0.16 renames these (bg-background-, fg-foreground-) and drops the old names entirely (WordPress/gutenberg#79098). So once the bundled @wordpress/* monorepo update (#49272) lands theme 0.16, these custom properties go undefined and the dashboard theming silently falls back to its hardcoded hex values (losing themed/dark surfaces).

This wraps each of the 15 references (6 dashboard SCSS files) to try the new name first, with the old name (and existing literal fallback) as the inner fallback:

var(--wpds-color-background-surface-neutral-strong, var(--wpds-color-bg-surface-neutral-strong, #fff))
  • Valid on both the currently pinned @wordpress/theme 0.15.1 and 0.16 — on trunk the new name is undefined so it resolves to the inner fallback, i.e. the exact original expression. Computed values are byte-identical today; there is no visual change on trunk. It simply keeps theming working after the bump.
  • --wpds-color-stroke-* tokens are unchanged in 0.16, so they are left as-is.
  • Decouples the Forms slice from the bundled-monorepo bump — no dependency in either direction, and nothing here touches that PR.

Related product discussion/links

  • WordPress/gutenberg token rename: #79098

Does this pull request change what data or activity we track or use?

No.

Testing instructions

  • On current trunk (@wordpress/theme 0.15.1): open the Forms admin — Responses/Inbox dashboard — and confirm it renders identically to before (surfaces, headers, tab colors, comment cards). The old token names still resolve through the fallback, so nothing should look different.
  • Forward-compat check: with the bundled @wordpress/theme 0.16 bump applied (e.g. the Update Bundled @wordpress/* monorepo #49272 branch), confirm the dashboard still themes correctly — now via the new --wpds-color-background-* / --wpds-color-foreground-* names — instead of dropping to hardcoded hex.
  • pnpm jetpack build forms compiles cleanly.

@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack), and enable the update/forms-wpds-color-token-fallbacks branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack update/forms-wpds-color-token-fallbacks

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!

@github-actions github-actions Bot added the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Jun 30, 2026
@CGastrell CGastrell self-assigned this Jun 30, 2026
@CGastrell CGastrell added [Status] Needs Review This PR is ready for review. and removed [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. labels Jun 30, 2026
@jp-launch-control

Copy link
Copy Markdown

Code Coverage Summary

This PR did not change code coverage!

That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷

Full summary · PHP report · JS report

CGastrell and others added 2 commits June 30, 2026 11:57
…heme 0.16

@wordpress/theme 0.16 renames the color design tokens (bg- -> background-,
fg- -> foreground-) and drops the old names entirely. The Forms dashboard SCSS
references the old names, so once theme 0.16 lands those vars go undefined and
theming falls back to hardcoded hex.

Reference the new token names first, with the existing name (and literal
fallback) as the inner fallback, so theming is correct on both 0.15.1 (current
trunk) and 0.16. Computed values are byte-identical on trunk. Stroke tokens are
unchanged in 0.16 and left as-is.

Decouples the Forms slice from the bundled-monorepo bump; no dependency on that
PR in either direction.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…0.16 transition

The fallback-chained color tokens reference both the 0.16 names and the current
0.15 names on the same line. The DS-token linter validates against a single
installed @wordpress/theme vocabulary (via @wordpress/stylelint-config), so it
flags whichever half isn't in the current vocabulary. Scope-disable the rule for
projects/packages/forms/src/dashboard/** until the bundled monorepo bump
(theme 0.16 + stylelint-config 23.41) lands; the override and the old-name
fallbacks are removed together afterwards. Rule stays active everywhere else.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@CGastrell
CGastrell force-pushed the update/forms-wpds-color-token-fallbacks branch from b39fa61 to 984d7cf Compare June 30, 2026 19:22
@CGastrell
CGastrell requested a review from a team as a code owner June 30, 2026 19:22
Significance: patch
Type: changed

Forms dashboard: reference the new WPDS color token names (--wpds-color-background-*/--wpds-color-foreground-*) with a fallback to the current names, so theming keeps working both before and after the @wordpress/theme 0.16 token rename.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems kind of verbose for end users. What do you think of something like this instead?

Suggested change
Forms dashboard: reference the new WPDS color token names (--wpds-color-background-*/--wpds-color-foreground-*) with a fallback to the current names, so theming keeps working both before and after the @wordpress/theme 0.16 token rename.
Forms dashboard: Improve compatibility with latest Gutenberg theming library.

Comment thread stylelint.config.mjs
*/
const config = {
extends: 'jetpack-js-tools/stylelint.config.base.mjs',
overrides: [

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it would be better to put this into a projects/packages/forms/stylelint.config.mjs file instead of the root.

I suppose, if it's really temporary, it doesn't matter much. Don't forget to clean this up though!

@CGastrell

Copy link
Copy Markdown
Contributor Author

Superseded by the full-repo token sweep. Per the discussion in jetpack-developers, the WPDS color token rename has to happen atomically with the bundled @wordpress/* bump (theme 0.16 + @wordpress/stylelint-config 23.41) — the no-unknown-ds-tokens validator uses a single repo-wide token vocabulary, so it can't be decoupled per package without suppressing the rule. Folding the Forms rename into the full sweep on top of #49272 instead (straight rename, no fallback/suppression needed since values are unchanged and the branch carries theme 0.16). Closing this.

@CGastrell CGastrell closed this Jun 30, 2026
@github-actions github-actions Bot removed the [Status] Needs Review This PR is ready for review. label Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants