-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Repair and refine embed block styles #14648
Repair and refine embed block styles #14648
Conversation
padding-top: 50%; // Default to 2:1 aspect ratio. | ||
} | ||
// Add responsiveness to embeds with aspect ratios. | ||
.wp-embed-responsive .wp-has-aspect-ratio { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To save some bytes, switched to .wp-has-aspect-ratio
rather than listing all the different aspect-ratios.
Any reason not to do this?
@@ -1,3 +1,11 @@ | |||
// Apply max-width to floated items that have no intrinsic width | |||
.block-editor-block-list__block[data-type^="core-embed"][data-align="left"] .block-editor-block-list__block-edit, | |||
.block-editor-block-list__block[data-type^="core-embed"][data-align="right"] .block-editor-block-list__block-edit { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not completely clear on this though. Maybe core/embed
is correct. I just now saw where thats used for the generic embed? Everything else appears to use something like core-embed/youtube
.
Are the generic embeds the only thing that doesn't have an intrinsic width?
Hello @m-e-h, apologies for not being able to look at this back when it was fresh. It is a good PR and should have landed ages ago. If you have the time and energy, I have tested this branch and it works as intended and should be good to merge if you rebase. In absence of that, I understand you may be busy, I took the liberty of creating #21599 which is simply a rebased copy of this branch, with props to you. Let me know if you'd like to rebase this and get it in, or whether we should move on with the other! Thanks again. |
I'm closing this one as I managed to port your code to #21599 and merge it! Thanks again. |
Description
editor.scss
[data-type="core/embed"]
to[data-type^="core-embed"]
and move these style rules fromstyle.scss
the more appropriateeditor.scss
.style.scss
iframe
foralignright
andalignleft
. Previously, on embeds without an aspect-ratio, floats weren't responsive and theiframe
would overflow it's container. (If using normalize.css this wouldn't be noticed)How has this been tested?
Tested visually with several themes including TwentyNineteen.
Types of changes
Bug fix
Checklist: