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

Image and video blocks break out of the content column on the Twenty Ten theme. #8334

Closed
kjellr opened this issue Jul 31, 2018 · 2 comments
Closed
Labels
[Block] Image Affects the Image Block [Block] Video Affects the Video Block [Feature] Blocks Overall functionality of blocks [Type] Bug An existing feature does not function as intended

Comments

@kjellr
Copy link
Contributor

kjellr commented Jul 31, 2018

Describe the bug

On the Twenty Ten theme, the image and video blocks break out of the content column and look broken.

This could be considered a theme bug (for an 8-year-old theme 🙂), but something as simple as an image block seems like it should work near-universally. Are we missing some default CSS that we should be including for cases like this?

Screenshots

Image:
atomic test_

Video:
atomic test__p 38

To Reproduce

  1. Start with a site using the Twenty Ten theme.
  2. Add an image or video block to a page.
  3. View the page.

Tested In
Mac OS 10.13.6, Safari 11.1.2
Mac OS 10.13.6, Chrome 67.0.3396.99
Gutenberg 3.4.0


Discovered during testing for #8291

@kjellr kjellr added [Type] Bug An existing feature does not function as intended [Feature] Blocks Overall functionality of blocks labels Jul 31, 2018
@pento
Copy link
Member

pento commented Aug 1, 2018

I had the same thing happen in p2 with videos. I hacked a fix into the p2's custom CSS, but I suspect this issue will be more widespread than just a handful of older themes.

For reference, this was the CSS I added:

.wp-block-video > video {
	width: 100%;
}

@sarahmonster sarahmonster mentioned this issue Aug 2, 2018
11 tasks
sarahmonster added a commit that referenced this issue Aug 2, 2018
Giving a max-width of 100% to the image and video blocks ensures
they won't break out of the content area of the site, regardless of
whether the theme has styling that prevents overflow.

Fixes #8334.
@sarahmonster
Copy link
Member

I'd be willing to bet this applies to lots of non-responsive themes, and I've seen the video overflow happen in a number of responsive themes, even. I suspect that means it'll be a reasonably widespread issue.

FYI this fix seems to work for me:

.wp-block-image {
    max-width: 100%;
}

.wp-block-image img {
    max-width: 100%;
}

.wp-block-image video {
    max-width: 100%;
}

...also available as a PR.

sarahmonster added a commit that referenced this issue Aug 3, 2018
Giving a max-width of 100% to the image and video blocks ensures
they won't break out of the content area of the site, regardless of
whether the theme has styling that prevents overflow.

Fixes #8334.
sarahmonster added a commit that referenced this issue Aug 3, 2018
Giving a max-width of 100% to the image and video blocks ensures
they won't break out of the content area of the site, regardless of
whether the theme has styling that prevents overflow.

Fixes #8334.
@sarahmonster sarahmonster added [Block] Image Affects the Image Block [Block] Video Affects the Video Block labels Oct 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Image Affects the Image Block [Block] Video Affects the Video Block [Feature] Blocks Overall functionality of blocks [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

3 participants