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

Gutenberg: Only baseline $content_width is used for images #29367

Closed
laurelfulford opened this issue Dec 12, 2018 · 1 comment
Closed

Gutenberg: Only baseline $content_width is used for images #29367

laurelfulford opened this issue Dec 12, 2018 · 1 comment
Labels
[Feature Group] Appearance & Themes Features related to the appearance of sites. [Goal] Gutenberg Working towards full integration with Gutenberg [Pri] Normal wp-admin

Comments

@laurelfulford
Copy link
Contributor

In Calypso, the block-based editor uses the theme's $content_width to set a size for images. But some themes have different $content_widths based on context (like certain templates, or when a sidebar isn't present); only the default one is used.

This differs from using the editor on a self-hosted site, where the default size is 1024px wide (the large image size); it may not be wide enough to cover all cases, but it is generally wider than most theme's $content_width.

It seems like a similar underlying issue to #29296, where the $content_width is also an issue when switching themes.

Steps to reproduce

  1. Start with a theme that sets multiple $content_widths -- Button 2 is one example. Its default $content_width is 663, but it's upped to 982 when the full-width template is used on a page, or there is no sidebar.
  2. Make sure there are no sidebar widgets.
  3. Insert an image block into the editor; note the size.
  4. Publish the post, and note the size.

What I expected

The image to fill the available space, both in the editor and on the front-end.

What happened instead

The image defaulted to the theme's main $content_width, rather than the one set on the page's template.

For Button 2, we can "hide" the issue by decreasing the editor width to 663 -- right now it uses the wider content width -- but the image will still be too narrow on publish.

The current work-around is manually adjusting the image size in the block options.

I understand work is still being done in the editor on image sizing. In the meantime, is it possible to use the widest $content_width present in a theme, or default to the "Large" image size instead?

Screenshot / Video

Image added to the editor:

image

Published version of post:

image

Context / Source

This was originally reported as an issue for Twenty Twelve (Automattic/themes#422); it could be reproduced in Sketch, and also came up when fixing another issue in Button 2.

@alisterscott alisterscott added [Goal] Gutenberg Working towards full integration with Gutenberg [Feature Group] Appearance & Themes Features related to the appearance of sites. wp-admin labels Dec 13, 2018
@mmtr
Copy link
Member

mmtr commented Mar 12, 2019

No longer reproducible after removing Gutenberg on Calypso in favor of #31196.

@mmtr mmtr closed this as completed Mar 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature Group] Appearance & Themes Features related to the appearance of sites. [Goal] Gutenberg Working towards full integration with Gutenberg [Pri] Normal wp-admin
Projects
None yet
Development

No branches or pull requests

4 participants