Gutenberg: Only baseline $content_width
is used for images
#29367
Labels
[Feature Group] Appearance & Themes
Features related to the appearance of sites.
[Goal] Gutenberg
Working towards full integration with Gutenberg
[Pri] Normal
wp-admin
In Calypso, the block-based editor uses the theme's
$content_width
to set a size for images. But some themes have different$content_width
s 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
$content_width
s -- 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.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:
Published version of post:
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.
The text was updated successfully, but these errors were encountered: