Skip to content
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

Backport typography block supports for WP 6.1 (refresh) #3237

Conversation

ironprogrammer
Copy link

Refresh of #3203.

From original PR:

❗ BLOCKED by #3199

Backporting typography block supports changes from Gutenberg to WP 6.1

See tracking issue: WordPress/gutenberg#43440

Gutenberg sync PR

Once this PR lands we can merge WordPress/gutenberg#43928

Main changes

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

Props @ramonjd.


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.

@ockham
Copy link
Contributor

ockham commented Sep 14, 2022

@ironprogrammer Thank you! The style engine PR has now been merged; would you mind rebasing this PR? 😊

@ironprogrammer ironprogrammer force-pushed the add/backport-typography-block-supports-wp-6-1 branch from 4184103 to c16d09e Compare September 14, 2022 23:20
@ironprogrammer
Copy link
Author

@ockham Done!

CC @ramonjd.

@ironprogrammer
Copy link
Author

Hmmm, the test failures may be related to #3199, which removes spaces between generated CSS attributes and values. Looking into it.

However, the tests in this PR are passing.

@andrewserong
Copy link
Contributor

Hmmm, the test failures may be related to #3199, which removes spaces between generated CSS attributes and values.

@ironprogrammer I think in this case I'd lean toward updating those existing tests. As you mention. the style engine intentionally defaults to not prettifying output, so inline styles therefore don't have spaces. Given that there'll be a slight mismatch until all of the block supports are merged, I wonder if the assert_content_and_styles_and_classes_match test function should be updated to be more permissive of spaces? (It currently normalizes spaces between property/value pairs, but not between the colon and the value here: https://github.com/WordPress/wordpress-develop/blob/trunk/tests/phpunit/tests/blocks/supportedStyles.php#L155)

Spaces are stripped between properties and values since WordPress#3199.
@ramonjd
Copy link
Member

ramonjd commented Sep 18, 2022

Thank for you for advancing this one!! 🙇

@hellofromtonya hellofromtonya self-assigned this Sep 19, 2022
@hellofromtonya
Copy link
Contributor

Currently testing and reviewing. When ready, will do the commit.

Copy link
Contributor

@hellofromtonya hellofromtonya left a comment

Choose a reason for hiding this comment

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

  • Meets coding standards ✅
  • Merge conflict fixed ✅
  • Test passing ✅

Ready for commit.

@hellofromtonya
Copy link
Contributor

Prepping commit now.

Comment on lines +356 to +361
$minimum_viewport_width = wp_get_typography_value_and_unit(
$minimum_viewport_width_raw,
array(
'coerce_to' => $font_size_unit,
)
);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this needed twice? @ockham

Copy link
Contributor

Choose a reason for hiding this comment

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

TBH I know next to nothing about this code -- I've only rebased it 😅

Speaking of rebase, maybe the duplicated code is a result of a slightly wonky rebase?

Copy link
Contributor

Choose a reason for hiding this comment

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

Nope, it's the original Gutenberg PR WordPress/gutenberg#39529.

Hey @ramonjd is this duplicate code needed?

Copy link
Contributor

Choose a reason for hiding this comment

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

Nope, it's the original Gutenberg PR WordPress/gutenberg#39529.

Ah, I hadn't noticed! Huh, weird.

(If it's blocking this from merging, I'd go out on a limb and say that we might remove it? 😅 )

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm going to remove it. If it's an issue, a Trac ticket can be opened to fix it during the beta cycle.

Copy link
Contributor

Choose a reason for hiding this comment

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

Scratch that - my bad 🤦‍♀️ The 2nd time is for the minimum. Sorry for the confusion. Leaving it in (and smacking my forehead 🤣 ).

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the ping, folks!

Yep, one is for $minimum_viewport_width and the other for $maximum_viewport_width.

If you think the vars could be named more clearly feel free to change. I can sync in Gutenberg today.

@hellofromtonya
Copy link
Contributor

Committed via https://core.trac.wordpress.org/changeset/54260. Thank you everyone for contributions!

Sign up for free to 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.

5 participants