Skip to content

Theme: Add Sass fallback helper root entrypoint - #79471

Merged
mirka merged 3 commits into
revert/reapply-wpds-sass-fallbacksfrom
fix/theme-sass-fallback-entrypoint
Jun 25, 2026
Merged

mirka merged 3 commits into
revert/reapply-wpds-sass-fallbacksfrom
fix/theme-sass-fallback-entrypoint

Conversation

@mirka

@mirka mirka commented Jun 24, 2026 •

Copy link
Copy Markdown
Member

What?

Stacked on #79470

Adds a package-root Sass shim for @wordpress/theme/design-token-fallbacks and points the package export at that stable entry point.

Why?

The Sass fallback helper needs to work in both package-export-aware build tools and older Sass setups that resolve packages from node_modules with a load path. Exporting or documenting a generated src/prebuilt path would make package internals part of the public API.

This should unblock us to reinstall the changes that we reverted in #79429.

How?

Adds packages/theme/design-token-fallbacks.scss as a public shim that forwards to the generated helper. The package export now points to that shim with Sass/style/default conditions, and the docs use the same public @wordpress/theme/design-token-fallbacks import for both package importer and load-path Sass setups.

Testing Instructions

  1. Run npm run storybook:build.
  2. Confirm the build completes successfully.

@github-actions github-actions Bot added the [Package] Theme /packages/theme label Jun 24, 2026
@github-actions

Copy link
Copy Markdown

Size Change: 0 B

Total Size: 7.52 MB

compressed-size-action

@mirka mirka self-assigned this Jun 24, 2026
@github-actions github-actions Bot added the [Package] Base styles /packages/base-styles label Jun 24, 2026
@github-actions

Copy link
Copy Markdown

Flaky tests detected in 152ba72.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/28083481924
📝 Reported issues:

@mirka mirka added the [Type] Enhancement A suggestion for improvement. label Jun 24, 2026
@mirka
mirka marked this pull request as ready for review June 24, 2026 10:01
@mirka
mirka requested a review from a team as a code owner June 24, 2026 10:01
@github-actions

github-actions Bot commented Jun 24, 2026 •

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: mirka <0mirka00@git.wordpress.org>
Co-authored-by: ciampo <mciampini@git.wordpress.org>
Co-authored-by: aduth <aduth@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@ciampo ciampo 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.

Nice, the new import path also feels cleaner 🚀

@@ -0,0 +1 @@
@forward "./src/prebuilt/scss/design-token-fallbacks";

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.

TIL @forward

Comment thread packages/theme/package.json Outdated
Comment on lines +43 to +45
"sass": "./design-token-fallbacks.scss",
"style": "./design-token-fallbacks.scss",
"default": "./design-token-fallbacks.scss"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are all of these needed? 🤔

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I looked into this a bit more, and I've concluded that we want either:

  1. sass condition only (supports both legacy and modern setups)
  2. No conditionals at all (supports only the legacy setup, but matches the rest of the repo)

The sass condition seems to be the recommended way for the modern NodePackageImporter setup. So I guess it's good to start supporting that, too.

@mirka
mirka merged commit fda0164 into revert/reapply-wpds-sass-fallbacks Jun 25, 2026
39 of 41 checks passed
@mirka
mirka deleted the fix/theme-sass-fallback-entrypoint branch June 25, 2026 08:35
mirka added a commit that referenced this pull request Jun 26, 2026
* Reapply "Base Styles: Add wpds-var Sass helper for design token fallbacks (#78698)" (#79429)

This reverts commit 3031bb0.

* Theme: Add Sass fallback helper root entrypoint (#79471)

* Theme: Add Sass fallback helper shim

* Theme: Fix Sass fallback helper imports

* Theme: Remove fallback Sass export conditions

Co-authored-by: mirka <0mirka00@git.wordpress.org>
Co-authored-by: ciampo <mciampini@git.wordpress.org>
Co-authored-by: aduth <aduth@git.wordpress.org>

* Fix focus ring docblock formatting

* Update Sass token utility entrypoint

* Add changelog

---------

Co-authored-by: ciampo <mciampini@git.wordpress.org>
Co-authored-by: aduth <aduth@git.wordpress.org>
Co-authored-by: mirka <0mirka00@git.wordpress.org>
Co-authored-by: simison <simison@git.wordpress.org>
SainathPoojary pushed a commit to SainathPoojary/gutenberg that referenced this pull request Jun 29, 2026
* Reapply "Base Styles: Add wpds-var Sass helper for design token fallbacks (WordPress#78698)" (WordPress#79429)

This reverts commit 3031bb0.

* Theme: Add Sass fallback helper root entrypoint (WordPress#79471)

* Theme: Add Sass fallback helper shim

* Theme: Fix Sass fallback helper imports

* Theme: Remove fallback Sass export conditions

Co-authored-by: mirka <0mirka00@git.wordpress.org>
Co-authored-by: ciampo <mciampini@git.wordpress.org>
Co-authored-by: aduth <aduth@git.wordpress.org>

* Fix focus ring docblock formatting

* Update Sass token utility entrypoint

* Add changelog

---------

Co-authored-by: ciampo <mciampini@git.wordpress.org>
Co-authored-by: aduth <aduth@git.wordpress.org>
Co-authored-by: mirka <0mirka00@git.wordpress.org>
Co-authored-by: simison <simison@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Base styles /packages/base-styles [Package] Theme /packages/theme [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants