Skip to content

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

Open
CGastrell wants to merge 1 commit into
trunkfrom
update/forms-wpds-color-token-fallbacks
Open

Forms: forward-compatible WPDS color token fallbacks for @wordpress/theme 0.16#50082
CGastrell wants to merge 1 commit 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.

…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>
@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

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.

1 participant