WordPress.org

Make WordPress Core

Opened 8 months ago

Last modified 8 months ago

#46262 new defect (bug)

Twenty Nineteen: odd content_width in theme

Reported by: nosilver4u Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 5.0.3
Component: Bundled Theme Keywords:
Focuses: Cc:
PR Number:

Description

The global value $content_width is set to 640px in Twenty Nineteen. I can't see anywhere that this value even makes sense. Any text within an article is in a box 932px wide, and the posts themselves are in a container that is 1524px.

Now, what does it matter? The theme displays things correctly via CSS, but this value is used by image optimization features in Jetpack and EWWW Image Optimizer (possibly others). The result is that we have 640px images (roughly) displaying in containers that are at least 932px. Best I can tell, Twenty Nineteen will display them at whatever size the user chooses: large=1024px, while full-width is 1905px, and wide-width is 1404px.

Perhaps there is information from Gutenberg itself that can be leveraged by these plugins, but setting content_width to a more sensible default would be a good start.

Change History (1)

#1 @laurelfulford
8 months ago

  • Milestone changed from Awaiting Review to Future Release
  • Summary changed from odd content_width in Twenty Nineteen theme to Twenty Nineteen: odd content_width in theme

Thanks for this report, @nosilver4u!

I suspect the current 640px comes from the theme being based on Underscores, since that's the default there: https://github.com/Automattic/_s/blob/master/functions.php#L97

I agree that it should be updated to reflect actual widths in the theme.

Note: See TracTickets for help on using tickets.