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

Add Center Align Support to Embed Blocks #41011

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

thexavismith
Copy link

@thexavismith thexavismith commented May 11, 2022

What?

Adding center align support to embed blocks

Why?

#15130

The issue was also identified here: Automattic/wp-calypso#38441

How?

The PR makes .wp-embed-block__wrapper a flex container and centers the content if the .aligncenter class is applied.

Testing Instructions

  1. Create a new page or post
  2. Add an embed block (i.e. Twitter)
  3. Center align the block
  4. Verify that the block is centered in the preview and frontend

Screenshots or screencast

CleanShot 2022-05-11 at 15 17 34@2x

@thexavismith thexavismith requested a review from ajitbohra as a code owner May 11, 2022 22:18
@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label May 11, 2022
@github-actions
Copy link

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @smithtimmytim! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@carolinan
Copy link
Contributor

carolinan commented May 12, 2022

For twitter embeds, this works for me on the front but not in the block editor.
To test centering, we need to place the block in a container that is wider than regular content, for example a full width group block (Since with regular content width, center and "none" would look the same in the block editor).

Is there an easy way to test all embeds at once?

@carolinan carolinan added the [Block] Embed Affects the Embed Block label May 12, 2022
@carolinan
Copy link
Contributor

Tagging this open issue: #15130

@carolinan carolinan added the [Type] Bug An existing feature does not function as intended label May 12, 2022
@thexavismith
Copy link
Author

Centering the embed in the editor is a bit harder. On the frontend, it seems the embed is adding its actual width whereas on the editor side, the iframe is filling all the available space

@scruffian scruffian mentioned this pull request May 17, 2022
23 tasks
@carolinan
Copy link
Contributor

@smithtimmytim Hi, are you still working on this pull request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Embed Affects the Embed Block First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants