Skip to content

Backporting block supports [border, color, elements, spacing] from Gutenberg to WP 6.1 - #3204

Closed
ramonjd wants to merge 10 commits into
WordPress:trunkfrom
ramonjd:update/backport-border-color-elements-spacing-block-supports-6-1
Closed

Backporting block supports [border, color, elements, spacing] from Gutenberg to WP 6.1#3204
ramonjd wants to merge 10 commits into
WordPress:trunkfrom
ramonjd:update/backport-border-color-elements-spacing-block-supports-6-1

Conversation

@ramonjd

@ramonjdramonjd commented Sep 7, 2022

Copy link
Copy Markdown
Member

❗ BLOCKED by #3199Edit: #3199 has been merged.

Backporting border, color, elements, spacing block supports changes from Gutenberg to WP 6.1

Typography is taken care of over in #3203

See tracking issue: WordPress/gutenberg#43440

Trac ticket: https://core.trac.wordpress.org/ticket/56467


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@ramonjd
ramonjdforce-pushed the update/backport-border-color-elements-spacing-block-supports-6-1 branch from 1614ef8 to c20ddd2CompareSeptember 9, 2022 11:32
@glendaviesnzglendaviesnz mentioned this pull request Sep 15, 2022
@ockham
ockhamforce-pushed the update/backport-border-color-elements-spacing-block-supports-6-1 branch from c20ddd2 to 569db97CompareSeptember 15, 2022 13:25
@ockham

Copy link
Copy Markdown
Contributor

Rebased, now that #3199 has landed.

@ockham

Copy link
Copy Markdown
Contributor

Unit tests are failing -- apparently because of extra whitespace in the "expected" string. Errors look like this:

1) Test_Block_Supports_Border::test_border_color_slug_with_numbers_is_kebab_cased_properly
Failed asserting that two arrays are identical.
--- Expected
+++ Actual
@@ @@
Array &0 (
'class' => 'has-border-color has-red-border-color'
- 'style' => 'border-radius: 10px; border-style: dashed; border-width: 1px;'
+ 'style' => 'border-radius:10px;border-style:dashed;border-width:1px;'
)
/var/www/tests/phpunit/tests/block-supports/border.php:70
phpvfscomposer:///var/www/vendor/phpunit/phpunit/phpunit:97
/var/www/vendor/bin/phpunit:118

@ockham

Copy link
Copy Markdown
Contributor

A similar issue seems to be present over at #3237 (comment)

@ramonjd

Copy link
Copy Markdown
MemberAuthor

I'll rebase and fix. Sorry, was out of action last week.

@ramonjd
ramonjdforce-pushed the update/backport-border-color-elements-spacing-block-supports-6-1 branch from 569db97 to ec6ea9dCompareSeptember 19, 2022 00:43
…ons. The Style Engine does not prettify by default.
@ramonjd
ramonjdforce-pushed the update/backport-border-color-elements-spacing-block-supports-6-1 branch from 7b8a48c to 9a01f76CompareSeptember 19, 2022 01:17
@ramonjd

Copy link
Copy Markdown
MemberAuthor

Unit tests are failing -- apparently because of extra whitespace in the "expected" string. Errors look like this:

@ockham Good to go I think.

Comment on lines +115 to +121
wp_style_engine_get_styles(
$link_block_styles,
array(
'selector' => ".$class_name a",
'context' => 'block-supports',
)
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we have to do something with the return value? 🤔

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried a paragraph block with a link and the link color set to orange, and it really isn't reflected on the frontend:

image

image

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, looks like this needs #3273 in order for the relevant styling to be added!

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we have to do something with the return value? 🤔

Not here since the style engine will register styles in a store using the context as key. Gutenberg fetches stored styles at render time and prints them out.

@ockhamockham left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. We might want to land #3273 first and rebase this PR (see #3204 (comment)).

@audrasjbaudrasjb self-assigned this Sep 19, 2022

@costdevcostdev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for handling this PR @ramonjd Just one minor suggestion 🙂

Comment threadsrc/wp-includes/block-supports/border.php Outdated
audrasjband others added 7 commits September 19, 2022 20:58
better consistency for `since` mentions.
Co-authored-by: Colin Stewart <79332690+costdev@users.noreply.github.com>
better consistency for `since` mentions.
better consistency for `since` mentions.
better consistency for `since` mentions.
Better consistency for `since` mentions
Better consistency for `since` mentions
Better consistency for `since` mentions
@audrasjb

Copy link
Copy Markdown
Contributor

Committed in https://core.trac.wordpress.org/changeset/54211

@ramonjd

Copy link
Copy Markdown
MemberAuthor

Thanks for all the help, folks!

@ramonjd
ramonjd deleted the update/backport-border-color-elements-spacing-block-supports-6-1 branch September 27, 2022 03:28
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

4 participants

@ramonjd@ockham@audrasjb@costdev