Repository navigation
Shadow: Add a PHP helper for block support classes and styles - #84205
aaronrobertshaw wants to merge 5 commits into
Conversation
🤖 PR meta 🤖🎉 PropsIf you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Updated as activity occurs, without notifying anyone named here. Add the 📦 Bundle sizeSize Change: 0 B Total Size: 9.05 MB
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
🏁 Flaky testsSome 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. Regression: updating a specific option will only change its value and will not corrupt others in
|
49710a1 to
4135ece
Compare
48b5f24 to
ee2145e
Compare
4f78f3f to
d1bd21f
Compare
Search and Icon now get their shadow from the helper, like the other blocks in this PR, with the same output as trunk. Each gets one render test. The tests now cover the helper's own cases and one migration per block. Cases that re-tested the style engine are dropped.
2babf82 to
9258290
Compare
Follows up on #83122.
Core backport: wordpress-develop#14094.
Related:
What?
Adds a PHP helper that turns a block's shadow into inline styles, like the JS
getShadowClassesAndStyles().The shadow block support and six blocks now use it.
Why?
Blocks that skip shadow serialization apply the shadow to an inner element, so they build the styles by hand. Six do, each with its own style engine call. A shared helper gives them one place to change.
How?
The helper only builds output. It doesn't check what a block supports. Each caller decides where the output goes.
prefixFunctions, so the plugin callsgutenberg_get_shadow_classes_and_styles()No output changes.
Testing Instructions
Use of AI Tools
Implemented and tested by a Claude Code agent from a predefined task.