Repository navigation
Block Supports: Show block style variation colors over a block type text gradient - #15366
aaronrobertshaw wants to merge 3 commits into
Conversation
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
…ext gradient. When a block type sets a text gradient (a background gradient clipped to the text), a block style variation's text color was hidden behind it. The variation's instance stylesheet is built from the variation alone, so it could not see the block type's text clip to escape it. Pass the merged block type styles to the instance stylesheet through a private `text_clip_base_blocks` option, and use them to escape the text clip in the variation's main, breakpoint and pseudo-state rules. Synced from WordPress/gutenberg#86164.
…t clip base. A block pseudo node, such as `:hover`, lists the block's style variations too. The variation rule it re-emits used the pseudo styles as its text clip base, so a clip set only in `:hover` added escapes to the variation's resting rule. Read the block's own styles instead. Drops the instance box clip test, which the text clip helper tests already cover, and adds a `WP_Theme_JSON` regression test for the pseudo node case. Synced from WordPress/gutenberg#86164.
bb64b43 to
95c0208
Compare
|
This should be ready for review. One thing to note: #15432 changes the same variation rules, so whichever lands second needs a small rebase. |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
ramonjd
left a comment
There was a problem hiding this comment.
Compared PR with Gutenberg #86164 === matches.
wp_ prefixes / @ticket 66438 annotations / tests pass for me locally too
Thanks!
Two notes:
Backport of Gutenberg PR WordPress/gutenberg#86164
Trac ticket: https://core.trac.wordpress.org/ticket/66438
Fixes a block style variation text color being hidden when the block type sets a text gradient. Reported in WordPress/gutenberg#84599.
This PR backports:
text_clip_base_blocksoption forWP_Theme_JSON::get_stylesheet(),wp_render_block_style_variation_support_styles(),WP_Theme_JSONtests.The editor side of the fix arrives later with the Gutenberg package update.
Overlap: #15432 changes the same block style variation rules in
WP_Theme_JSON::get_styles_for_block(), so whichever of the two merges second needs a small rebase that keeps$text_clip_base_block_stylesin the variation and breakpoint text clip bases. #15433 touches nearby lines inclass-wp-theme-json.phpbut merges cleanly with this PR.Testing instructions
Note
Only the front end is fixed in this PR. The editor still shows the gradient until the Gutenberg package update. Check the front end.
functions.php:block-style-variation-styles-inline-cssstyle tag. It should contain a rule like this (the number suffix can differ):On trunk the rule has no
-webkit-text-fill-color, and the gradient still paints the letters.Use of AI
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: The mechanical port, tests and this description.