Repository navigation
Block Supports: Show block style variation colors over a block type text gradient - #15366
Draft
aaronrobertshaw wants to merge 3 commits into
Draft
aaronrobertshaw wants to merge 3 commits into
aaronrobertshaw wants to merge 3 commits into
Conversation
…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.
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
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.