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

Quote Block: Fix the Quote block layout supports. #55240

Merged
merged 1 commit into from
Nov 12, 2023

Conversation

shimotmk
Copy link
Contributor

What?

Fix #55076
Quote Block: Fix the Quote block layout supports.

trunk

quote.mp4

this branch

trunk.mp4

Testing Instructions

  1. Place Image Block in the Quote block.
    or paste the HTML below.
<!-- wp:quote -->
<blockquote class="wp-block-quote"><!-- wp:paragraph -->
<p>aaa</p>
<!-- /wp:paragraph -->

<!-- wp:image {"align":"center","id":7335,"width":"311px","height":"auto","scale":"cover","sizeSlug":"full","linkDestination":"none"} -->
<figure class="wp-block-image aligncenter size-full is-resized"><img src="https://s.w.org/images/core/5.3/MtBlanc1.jpg" alt="" class="wp-image-7335" style="object-fit:cover;width:311px;height:auto"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>bbb</p>
<!-- /wp:paragraph --></blockquote>
<!-- /wp:quote -->
  1. Change the align.
  2. The alignment change.

Added block supports in the same way as the Details block🗒

"layout": {
"allowEditing": false
}

@github-actions
Copy link

Warning: Type of PR label error

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Type-related labels to choose from: [Type] Automated Testing, [Type] Breaking Change, [Type] Bug, [Type] Build Tooling, [Type] Code Quality, [Type] Copy, [Type] Developer Documentation, [Type] Enhancement, [Type] Experimental, [Type] Feature, [Type] New API, [Type] Task, [Type] Performance, [Type] Project Management, [Type] Regression, [Type] Security, [Type] WP Core Ticket, Backport from WordPress Core.
  • Labels found: .

Read more about Type labels in Gutenberg.

1 similar comment
@github-actions
Copy link

Warning: Type of PR label error

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Type-related labels to choose from: [Type] Automated Testing, [Type] Breaking Change, [Type] Bug, [Type] Build Tooling, [Type] Code Quality, [Type] Copy, [Type] Developer Documentation, [Type] Enhancement, [Type] Experimental, [Type] Feature, [Type] New API, [Type] Task, [Type] Performance, [Type] Project Management, [Type] Regression, [Type] Security, [Type] WP Core Ticket, Backport from WordPress Core.
  • Labels found: .

Read more about Type labels in Gutenberg.

@richtabor richtabor added [Type] Bug An existing feature does not function as intended [Block] Quote Affects the Quote Block [Package] Blocks /packages/blocks labels Oct 11, 2023
@shimotmk
Copy link
Contributor Author

shimotmk commented Nov 1, 2023

This pull request contains almost identical changes to the following pull request:
#53282
Could you please review it, @tellthemachines and @ramonjd and @andrewserong?

@ramonjd
Copy link
Member

ramonjd commented Nov 2, 2023

This is working well for me, thanks for creating the PR @shimotmk

I'd be more confident with a second ✅ from @tellthemachines or @andrewserong

Copy link
Contributor

@tellthemachines tellthemachines left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! LGTM and works as expected.

@andrewserong
Copy link
Contributor

andrewserong commented Nov 10, 2023

I like the idea here, too, thanks for working on it! One potential challenge is that this will also affect the spacing between blocks in block markup that's out in the wild as currently (prior to this PR) no layout spacing rules are applied for Quote block children. Is that an issue?

Arguably, for sites that use the layout spacing rules, I think this PR should provide more consistency as the spacing will be the same as if the blocks were wrapped in a Group block. So, while it might create a difference, that difference could arguably be thought of as a bug fix, too 🤔

@tellthemachines
Copy link
Contributor

this will also affect the spacing between blocks in block markup that's out in the wild as currently (prior to this PR) no layout spacing rules are applied for Quote block children. Is that an issue?

Good question! I'd say not necessarily. If themes have provided custom spacings styles for the block they will likely have higher specificity than the default layout styles so there won't be any visible difference. If themes haven't provided those styles I'd assume they're good with whatever the default is, whether that's browser or core styles 😄

But that does raise the question of whether we should add explicit support for spacing to this block, so folks can change it if the default isn't to their liking.

@andrewserong
Copy link
Contributor

If themes have provided custom spacings styles for the block they will likely have higher specificity than the default layout styles so there won't be any visible difference

Great point, with the lower specificity in place, that does sound safer now than it would have been in the past 👍

But that does raise the question of whether we should add explicit support for spacing to this block, so folks can change it if the default isn't to their liking.

Good idea, I think that'd be a good thing to add, and together those two points probably mitigate any major backcompat concerns as it gets the block to behave in a way that's more consistent with layout spacing styles overall, while giving users (and themes) more control. If not this PR, we could always add in the blockGap support in a quick follow-up PR 🙂

This PR is testing nicely for me otherwise!

@tellthemachines
Copy link
Contributor

Thanks for the input @andrewserong! I'm going to go ahead and merge this, then we can add block gap support separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Quote Affects the Quote Block [Package] Blocks /packages/blocks [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Quote Block: Blocks within the Quote block cannot be right-aligned or centered.
5 participants