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

Full-width images regardless of alignment when up to 768px #1671

Merged
merged 11 commits into from
Apr 22, 2019

Conversation

benlk
Copy link
Collaborator

@benlk benlk commented Apr 20, 2019

Originally opened by @seanchayes in #1630 for #1611. Opening from within INN/Largo so that I can push a bunch of work from on top of his base.

Changes

  • Sets the width of aligned (left, right, center, none) images and blocks and other classes to 100% with max-width 100% and float:none below 767px viewport width.
  • Makes sure that the caption of image blocks doesn't mess itself up, through the application of display: table on the captioned figure. The non-caption width changes here were causing the caption to appear in the form of a few-word-wide column below and to the left of the image, rather than being the full width of it.
  • Applies Largo's caption styles to image blocks, for consistency.
"Before" screenshots: Screen Shot 2019-04-19 at 21 56 01 Screen Shot 2019-04-19 at 21 56 09
"After" screenshots: Screen Shot 2019-04-19 at 21 40 25 Screen Shot 2019-04-19 at 21 40 56 Screen Shot 2019-04-19 at 21 41 06 Screen Shot 2019-04-19 at 21 41 14

@benlk benlk added type: improvement community contribution category: styles affects lots of styles, requiring visual testing category: gutenberg Relating to general Gutenberg compatibility labels Apr 20, 2019
@benlk benlk added this to the 0.6.2 milestone Apr 20, 2019
@benlk benlk self-assigned this Apr 20, 2019
@benlk benlk requested a review from joshdarby April 20, 2019 01:58
@benlk
Copy link
Collaborator Author

benlk commented Apr 22, 2019

To-do list:

  • Figure out what viewport width makes sense for these images to lose the floats and max-width, and become width: 100%; on a given post template.
  • Test on all viewport sizes on all browsers, for both posts and pages, for the following templates:
    • single-column
    • two-column
    • series landing page description/post-content
    • "full width" template

@benlk
Copy link
Collaborator Author

benlk commented Apr 22, 2019

This doesn't work in the Classic Editor for images, because the max-width is set on the parent div using an inline style.

The image width doesn't expand because it's not the target of the styles introduced in this PR.

Screen Shot 2019-04-22 at 12 35 27

Screen Shot 2019-04-22 at 12 35 34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: gutenberg Relating to general Gutenberg compatibility category: styles affects lots of styles, requiring visual testing community contribution type: improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants