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

Fixed some Embed's width in the editor. #6212

Merged
merged 1 commit into from
Apr 18, 2018
Merged

Conversation

jorgefilipecosta
Copy link
Member

@jorgefilipecosta jorgefilipecosta commented Apr 16, 2018

Description

This Pr corrects a style rule so the non-video embed's also become responsive (videos like youtube already were).

Fixes: #5757

How has this been tested?

Verify the problem described in #5757 does not happen and the embed correctly resizes to the available space.

@jorgefilipecosta jorgefilipecosta added the [Type] Bug An existing feature does not function as intended label Apr 16, 2018
@jorgefilipecosta jorgefilipecosta self-assigned this Apr 16, 2018
@jasmussen
Copy link
Contributor

Yup. Works for me! Nice work. 👍 👍

@jorgefilipecosta jorgefilipecosta merged commit 48ce55a into master Apr 18, 2018
@jorgefilipecosta jorgefilipecosta deleted the fix/embed-width branch April 18, 2018 12:23
@jorgefilipecosta jorgefilipecosta added this to the 2.7 milestone Apr 18, 2018
@@ -142,6 +142,9 @@ class Sandbox extends Component {
width: 100%;
height: 100%;
}
body > div > iframe {
Copy link
Member

Choose a reason for hiding this comment

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

Isn't the above body.video > div > iframe now redundant with this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hi @aduth ,

Isn't the above body.video > div > iframe now redundant with this?

The part that applies width is, but the rule also sets height for videos and is not applying just to the equivalent selector (body > div > iframe / body.video > div > iframe) but also to other selectors. The equivalent rules without redundancy would be:

			body.video,
			body.video > div,
			body.video > div > iframe {
				height: 100%;
			}

			body.video,
			body.video > div,
			body > div > iframe {
				width: 100%;
			}

or

			body.video,
			body.video > div,
				width: 100%;
				height: 100%;
			}
			body.video > div > iframe {
				height: 100%;
			}
			body > div > iframe {
				width: 100%;
			}

Both alternatives seem worse compared to what we have so preferred to keep selectors for video different from the general ones.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, right, I missed the other style.

Still, it seems odd that there's overlap, with some styles targeting video specifically, if it's more of a general issue with iframes in embedded content.

nuzzio pushed a commit to nuzzio/gutenberg that referenced this pull request Apr 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants