Skip to content

Add styles for WordPress embed block #2149

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

Merged
merged 2 commits into from
Mar 7, 2023
Merged

Conversation

tylersticka
Copy link
Member

@tylersticka tylersticka commented Mar 6, 2023

Overview

I attempted to embed a YouTube video using the WordPress "embed" block, but was surprised to see it didn't really apply any meaningful styles. This PR changes that so it will have parity with our other media blocks.

(I also removed usage of the deprecated defaultValue property from one of the other demos in the same file.)

Screenshots

Before After
Screenshot 2023-03-06 at 11 16 09 AM Screenshot 2023-03-06 at 11 15 26 AM

Testing

On the deploy preview, try out:

  • A video embed
    • Should display at the selected aspect ratio.
    • Should attempt to fill the margins (to a point) unless "center" alignment is selected.
  • A "rich" embed
    • Should display at the selected aspect ratio.
    • Should not attempt to fill margins unless "wide" or "full" alignment options are selected.

@netlify
Copy link

netlify bot commented Mar 6, 2023

Deploy Preview for cloudfour-patterns ready!

Name Link
🔨 Latest commit 6dbf13f
🔍 Latest deploy log https://app.netlify.com/sites/cloudfour-patterns/deploys/640667cc91fbb6000804dcf7
😎 Deploy Preview https://deploy-preview-2149--cloudfour-patterns.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@changeset-bot
Copy link

changeset-bot bot commented Mar 6, 2023

🦋 Changeset detected

Latest commit: 6dbf13f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@cloudfour/patterns Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@tylersticka tylersticka marked this pull request as ready for review March 6, 2023 19:34
@tylersticka tylersticka requested a review from a team March 6, 2023 19:34
spaceninja
spaceninja previously approved these changes Mar 6, 2023
@tylersticka tylersticka marked this pull request as draft March 6, 2023 21:23
@tylersticka
Copy link
Member Author

Just discovered an oversight in this: The margin enhancements should only apply to specific types of embeds (not Twitter, for example). Updating.

@tylersticka tylersticka marked this pull request as ready for review March 6, 2023 22:28
@tylersticka
Copy link
Member Author

I made a few changes:

  • I limited the negative alignment stuff to video embeds.
  • I added an example of a non-video embed.
  • I found a reference of WordPress aspect ratio classes and updated/expanded the classes here to match.

@tylersticka tylersticka requested a review from spaceninja March 6, 2023 22:29
@spaceninja
Copy link
Member

Should attempt to fill the margins (to a point) unless "center" alignment is selected.

What does this mean?

@tylersticka
Copy link
Member Author

What does this mean?

Video embeds will attempt to fill the container margins where possible.

I'm open to suggestions on how better to explain it, I'm drawing a blank right now.

@tylersticka tylersticka merged commit 833b7e3 into main Mar 7, 2023
@tylersticka tylersticka deleted the fix/wordpress-embed-block branch March 7, 2023 20:31
@github-actions github-actions bot mentioned this pull request Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Embed block contents do not fill their container
2 participants