PostCSS: add WPDS design token fallbacks#50108
Conversation
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
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:
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:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Code Coverage SummaryThis 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. 🤷 |
There was a problem hiding this comment.
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: truesetting forpostcss-custom-propertiesplugin, which changes how variables are renderered in final bundle. This is required for WPDS token usage, but conflicts with how@automattic/calypso-color-schemeswas configured before
I'm not seeing any changes in the output that seem related to this. 🤷
Ensure
@automattic/calypso-color-schemesgets loaded in the frontend at runtime (see the above point)
Or this.
| @@ -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} | |||
There was a problem hiding this comment.
I wonder why pnpm sometimes does this for certain people.
Proposed changes
var( --wpds-color-background-surface-neutral )→var( --wpds-color-background-surface-neutral, #fcfcfc )preserve: truesetting forpostcss-custom-propertiesplugin, which changes how variables are renderered in final bundle. This is required for WPDS token usage, but conflicts with how@automattic/calypso-color-schemeswas configured before which dates to times whenvar()support in browsers was lacking. See old comment for context.background: var( --wpds-color-bg-surface-neutral-strong );background: #fff;background: var( --wpds-color-bg-surface-neutral-strong, #fff );@automattic/calypso-color-schemesgets 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:
projects/js-packages/webpack-config/src/postcss.js(WIP).See build config and stylelint plugin docs for
@wordpress/themefor details.Related product discussion/links
Does this pull request change what data or activity we track or use?
Testing instructions
jetpack build packages/searchjetpack/projects/packages/search/src/dashboard/components/experience-selector/experience-option.scss
Lines 3 to 9 in a1548bf
projects/packages/search/build/dashboard/jp-search-dashboard.css: