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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions components/sandbox/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.

width: 100%;
}
body > div > * {
margin-top: 0 !important; /* has to have !important to override inline styles */
margin-bottom: 0 !important;
Expand Down