Skip to content

Global Styles: Migrate shadows presets to use the preset management layer. - #79812

Merged
juanfra merged 23 commits into
trunkfrom
enhance/global-styles-preset-migrate-shadows
Aug 11, 2026
Merged

Global Styles: Migrate shadows presets to use the preset management layer.#79812
juanfra merged 23 commits into
trunkfrom
enhance/global-styles-preset-migrate-shadows

Conversation

@juanfra

@juanfra juanfra commented Jul 2, 2026

Copy link
Copy Markdown
Member

What?

Built on top of #79810

Migrate the shadow presets to use the layer proposed in #79810. No functionality should be changing There may be a few minimal spacing changes due to the introduction of the recommended Stack component from @wordpres/ui. All strings stay unchanged.

Why?

Adopts the new shared preset-management layer (#79810) to remove duplicated code between preset managers, and to make it cheaper to add the next preset screens (Spacing, Border Radius) on top of it.

How?

Migrating to use <PresetGroup>, usePresets(), <PresetEditHeader> and the dialogs for renaming/deleting.

Testing Instructions

  1. Go to Site Editor > Styles > Shadows
  2. Custom: add a shadow, add/remove/edit parts (color, inset, x/y/blur/spread), rename, delete, then "Remove all custom shadows".
  3. Theme/Default (if your theme provides shadow.presets.theme or has shadow.defaultPresets on): edit a preset's value, confirm Reset is enabled in the edit menu, restore it, confirm Reset disables again.
  4. Delete a shadow while its edit screen is open. Confirm it navigates back cleanly.

Storybook

  • Run npm run storybook:dev
  • Go to Global Styles UI and check how the shadows are behaving with the new preset management.

Use of AI Tools

Cursor/Claude

@juanfra
juanfra marked this pull request as ready for review July 2, 2026 09:43
@juanfra
juanfra requested a review from manzoorwanijk as a code owner July 2, 2026 09:43
@github-actions

github-actions Bot commented Jul 2, 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: juanfra <juanfra@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>

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

@juanfra juanfra changed the title Migrate shadows presets to use the preset management layer. Global Styles: Migrate shadows presets to use the preset management layer. Jul 2, 2026
@juanfra juanfra added [Type] Enhancement A suggestion for improvement. Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json labels Jul 2, 2026
@juanfra
juanfra requested a review from Mamaduka July 2, 2026 09:45
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

Size Change: +191 B (0%)

Total Size: 7.82 MB

📦 View Changed
Filename Size Change
build/scripts/edit-site/index.min.js 311 kB +8 B (0%)
build/scripts/editor/index.min.js 510 kB +183 B (+0.04%)

compressed-size-action

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

Flaky tests detected in 8c60253.
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/30153193269
📝 Reported issues:

Base automatically changed from enhance/global-styles-preset-management to trunk July 25, 2026 09:39
@juanfra

juanfra commented Aug 4, 2026

Copy link
Copy Markdown
Member Author

Since rebasing we were getting an ESLint failure coming from #80754, which added some components to the not-recommended denylist. For now I'm suppressing them (same as #80754 did) and I'll treat them separately so this PR doesn't grow in scope or risk.

juanfra added 2 commits August 8, 2026 11:59
# Conflicts:
#	packages/global-styles-ui/src/confirm-reset-shadow-dialog.tsx
#	packages/global-styles-ui/src/shadows-edit-panel.tsx
#	packages/global-styles-ui/src/shadows-panel.tsx

@Mamaduka Mamaduka left a comment

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.

Works as expected. Thanks, @juanfra!

@juanfra
juanfra merged commit 7dc8595 into trunk Aug 11, 2026
45 checks passed
@juanfra
juanfra deleted the enhance/global-styles-preset-migrate-shadows branch August 11, 2026 07:02
@juanfra

juanfra commented Aug 11, 2026

Copy link
Copy Markdown
Member Author

Thanks a lot for the reviews George!

@github-actions github-actions Bot added this to the Gutenberg 23.8 milestone Aug 11, 2026
shail-mehta pushed a commit that referenced this pull request Aug 12, 2026
…ayer. (#79812)

* Migrate shadows presets to use the preset management layer.

Co-authored-by: juanfra <juanfra@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
t-hamano added a commit that referenced this pull request Aug 13, 2026
Trunk's shadows preset migration (#79812) removed
`confirm-reset-shadow-dialog.tsx`, which the text shadows screen still
imported, breaking the TypeScript build. Rebuild `ScreenTextShadows` on
the same `usePresets` + `PresetGroup` layer that `ShadowsPanel` now uses,
which drops the local `TextShadowList` component and routes the reset
confirmation through `presets/dialogs/confirm-reset-dialog`.

Also drop the now single-use `__text-shadows-panel__options-container`
selector in favour of the existing `__shadows-panel__options-container`,
which `shadows-edit-panel.tsx` already uses for the same purpose.

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Sponsor
SponsoredKunjungi sekarang
Promo