-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Group duotone outputs and refactor rendering #49705
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Flaky tests detected in ad8f98c. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4734482802
|
0e7119c to
6adec60
Compare
10fd25d to
ad8f98c
Compare
scruffian
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| * 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' ], | ||
| * ], | ||
| * ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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