Skip to content

Fix: Block style variations not rendering in Site Editor Patterns page#76122

Open
Mustafabharmal wants to merge 1 commit intoWordPress:trunkfrom
Mustafabharmal:fix/block-style-variations-patterns-preview
Open

Fix: Block style variations not rendering in Site Editor Patterns page#76122
Mustafabharmal wants to merge 1 commit intoWordPress:trunkfrom
Mustafabharmal:fix/block-style-variations-patterns-preview

Conversation

@Mustafabharmal
Copy link
Contributor

What?

Block style variations (e.g. the outline button) were not rendering in the Site Editor > Patterns page, they displayed as the default style instead.

Closes #76089

Why?

The useBlockStyleVariation hook reads settings[globalStylesDataKey] to generate per-block variation CSS via toStyles({ variationStyles: true }). This Symbol key is set by useBlockEditorSettings in the main editor provider path, but the Patterns page uses a separate ExperimentalBlockEditorProvider whose settings are built by usePatternSettings. That function spreads raw storedSettings from the edit-site store (PHP-initialized, carries no Symbol keys), so settings[globalStylesDataKey] was always undefined, no variation CSS was ever generated.

How?

Pass mergedConfig.styles (from useGlobalStyles(), already used in the same hook) as [ globalStylesDataKey ] in the pattern preview settings. This is the exact same data the main editor path uses.

Testing Instructions

  1. Activate TT5 theme
  2. Go to Editor > Patterns
  3. Select Call to action
  4. View patterns

Screenshots or screencast

Before After
image image

@github-actions
Copy link

github-actions bot commented Mar 4, 2026

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: Mustafabharmal <mustafabharmal@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: bgardner <bgardner@git.wordpress.org>

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

@github-actions github-actions bot added the [Package] Edit Site /packages/edit-site label Mar 4, 2026
@Mamaduka Mamaduka added the [Type] Bug An existing feature does not function as intended label Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Edit Site /packages/edit-site [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Outline button variation in patterns not rendering in site editor

2 participants