Skip to content

PostCSS: add WPDS design token fallbacks#50108

Draft
simison wants to merge 5 commits into
trunkfrom
update/wpds-fallback-values
Draft

PostCSS: add WPDS design token fallbacks#50108
simison wants to merge 5 commits into
trunkfrom
update/wpds-fallback-values

Conversation

@simison

@simison simison commented Jul 1, 2026

Copy link
Copy Markdown
Member

Proposed changes

  • Adds PostCSS configs for injecting WPDS token fallbacks:
    • var( --wpds-color-background-surface-neutral )var( --wpds-color-background-surface-neutral, #fcfcfc )
  • Flips preserve: true setting for postcss-custom-properties plugin, which changes how variables are renderered in final bundle. This is required for WPDS token usage, but conflicts with how @automattic/calypso-color-schemes was configured before which dates to times when var() support in browsers was lacking. See old comment for context.
    • Source: background: var( --wpds-color-bg-surface-neutral-strong );
    • In bundle before: background: #fff;
    • In bundle after: background: var( --wpds-color-bg-surface-neutral-strong, #fff );
  • Ensure @automattic/calypso-color-schemes gets loaded in the frontend at runtime (see the above point)

WP Build already has fallbacks configured, so parts of the repo built with it are already fine with adding fallbacks.

Separate follow-up PRs coming up for:

See build config and stylelint plugin docs for @wordpress/theme for details.

Related product discussion/links

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

Testing instructions

  • Lint is passing
  • Tokens get fallbacks in final bundles. A good way to test is with the search package:
    • jetpack build packages/search
    • These styles:
      .jp-search-experience-option {
      position: relative;
      padding: var(--wpds-dimension-padding-2xl);
      background: var(--wpds-color-bg-surface-neutral-strong);
      border: var(--wpds-border-width-xs) solid var(--wpds-color-stroke-surface-neutral);
      border-radius: var(--wpds-border-radius-lg);
      transition: border-color 120ms ease, box-shadow 120ms ease;
    • Now look like this at projects/packages/search/build/dashboard/jp-search-dashboard.css:
      .jp-search-experience-option {
      	position: relative;
      	padding: 24px;
      	padding: var(--wpds-dimension-padding-2xl, 24px);
      	background: #fff;
      	background: var(--wpds-color-bg-surface-neutral-strong, #fff);
      	border: 1px solid #dbdbdb;
      	border: var(--wpds-border-width-xs, 1px) solid var(--wpds-color-stroke-surface-neutral, #dbdbdb);
      	border-radius: 8px;
      	border-radius: var(--wpds-border-radius-lg, 8px);
      	transition: border-color 120ms ease, box-shadow 120ms ease;
      }
  • Spot check other bundles as well

@simison simison added [Status] Needs Review This PR is ready for review. Build labels Jul 1, 2026
@github-actions github-actions Bot added [Feature] Publicize Now Jetpack Social, auto-sharing [Package] Publicize [Package] Search Contains core Search functionality for Jetpack and Search plugins [Package] VideoPress [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Status] In Progress labels Jul 1, 2026
@github-actions

github-actions Bot commented Jul 1, 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!


Jetpack plugin:

The Jetpack plugin has different release cadences depending on the platform:

  • WordPress.com Simple releases happen as soon as you deploy your changes after merging this PR (PCYsg-Jjm-p2).
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly:
    • Scheduled release: July 7, 2026
    • Code freeze: July 6, 2026

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@github-actions

github-actions Bot commented Jul 1, 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 or WordPress.com Site Helper), and enable the update/wpds-fallback-values branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack update/wpds-fallback-values
bin/jetpack-downloader test jetpack-mu-wpcom-plugin update/wpds-fallback-values

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

@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

@anomiex anomiex left a comment

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.

This makes minimal changes to the built artifacts: the only thing I see is in several places some minimized code that (un-minified) looks something like

body.jetpack_page_jetpack-something .jp-admin-page-tabs {
    background: var(--wpds-color-bg-surface-neutral-strong);
    border-bottom: var(--wpds-border-width-xs) solid var(--wpds-color-stroke-surface-neutral-weak);

gets changed to

body.jetpack_page_jetpack-something .jp-admin-page-tabs {
    background: #fff;
    border-bottom: 1px solid #f0f0f0;

which is presumably exactly the intent. 👍

Flips preserve: true setting for postcss-custom-properties plugin, which changes how variables are renderered in final bundle. This is required for WPDS token usage, but conflicts with how @automattic/calypso-color-schemes was configured before

I'm not seeing any changes in the output that seem related to this. 🤷

Ensure @automattic/calypso-color-schemes gets loaded in the frontend at runtime (see the above point)

Or this.

Comment thread pnpm-lock.yaml
@@ -6859,130 +6862,130 @@ importers:
packages:

'@-xun/debug@2.0.2':
resolution: {integrity: sha512-qGaZ4bUZJuWc+YzndcaeOudFmHu4plOcjQGdod/8gafcZY+9oHkrsZNmA1tWrEpQwJV9AJ4QkYgfpreZp9W/Hg==}
resolution: {integrity: sha512-qGaZ4bUZJuWc+YzndcaeOudFmHu4plOcjQGdod/8gafcZY+9oHkrsZNmA1tWrEpQwJV9AJ4QkYgfpreZp9W/Hg==, tarball: https://registry.npmjs.org/@-xun/debug/-/debug-2.0.2.tgz}

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 why pnpm sometimes does this for certain people.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Build [Feature] Publicize Now Jetpack Social, auto-sharing [Package] Publicize [Package] Search Contains core Search functionality for Jetpack and Search plugins [Package] VideoPress [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Status] In Progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants