Group duotone outputs and refactor rendering#49705
Merged
Merged
Conversation
This was referenced Apr 11, 2023
Merged
|
Flaky tests detected in ad8f98c. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4734482802
|
0e7119c to
6adec60
Compare
Base automatically changed from
fix/deprecate-remaining-global-duotone-functions
to
trunk
April 18, 2023 15:41
10fd25d to
ad8f98c
Compare
ajlende
commented
Apr 18, 2023
Comment on lines
+77
to
90
| * being output on the page. Organized by an id of the preset/color group and the information needed | ||
| * to generate the SVG and CSS at render. | ||
| * | ||
| * Example: | ||
| * [ | ||
| * 'blue-orange' => [ | ||
| * 'wp-duotone-blue-orange' => [ | ||
| * 'slug' => 'blue-orange', | ||
| * 'colors' => [ '#0000ff', '#ffcc00' ], | ||
| * ], | ||
| * 'wp-duotone-000000-ffffff-2' => [ | ||
| * 'slug' => 'wp-duotone-000000-ffffff-2', | ||
| * 'slug' => '000000-ffffff-2', | ||
| * 'colors' => [ '#000000', '#ffffff' ], | ||
| * ], | ||
| * ] |
Contributor
Author
There was a problem hiding this comment.
This changed from being keyed by slug to being keyed by id so that the id didn't have to get recomputed again later. The key in the second part of the example (wp-duotone-000000-ffffff-2) was wrong before, but it's right now which is why it didn't change.
12 tasks
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.
What?
Part 3 in a set of duotone php refactoring to fix small issues in duotone rendering.
This part is the refactoring that changes the most duotone rendering logic. It moves the stylesheet genration (style engine) code into its own action that happens after all blocks have rendered.
Also included is a small fix for classic themes that would always try outputting a stylesheet even if no duotone filters were present.
Why?
<defs>group instead of having nested SVGs.How?
output_block_stylesas a companion tooutput_global_stylesthat handles the style engine rendering for all blocks in a single go.Testing Instructions
Example content for TT3 block-out, canary, and pilgrimage variations