themes icon indicating copy to clipboard operation
themes copied to clipboard

Twenty Sixteen: Some center-aligned images are not centered on live site

Open jp-imagines opened this issue 2 years ago • 14 comments

Quick summary

Some images on Twenty Sixteen have a below-post-meta class on either the figure or img element. For some reason, there's a style applying -40% left margin to those, preventing them from ever being centered.

Steps to reproduce

  1. Activate Twenty Sixteen.
  2. Create a post with some images which are set to align center.
  3. View the post on the live site.

What you expected to happen

Images set to align center should be centered.

What actually happened

Some images are not centered:

MGMUxU.png

Browser

No response

Context

6742797-zd-a8c

Platform (Simple, Atomic, or both?)

Simple

Other notes

Only replicated on Simple so far. Tried a few other themes and couldn't replicate there. User reports this started only a few days ago.

Reproducibility

Consistent

Severity

Some (< 50%)

Available workarounds?

Yes, easy to implement

Workaround details

CSS fix:

body:not(.search-results) article:not(.type-page) figure.aligncenter img.below-entry-meta, body:not(.search-results) article:not(.type-page) figure.below-entry-meta.aligncenter {
    margin-left: 0;
}

jp-imagines avatar Aug 29 '23 20:08 jp-imagines

Support References

This comment is automatically generated. Please do not edit it.

  • [ ] 6742797-zen
  • [ ] 6765538-zen
  • [ ] 6761812-zen
  • [ ] 6798174-zen
  • [ ] 6752201-zen
  • [ ] 7070495-zen
  • [ ] 7082359-zen
  • [ ] 7186086-zen
  • [ ] 7268524-zen
  • [ ] 7539540-zen

github-actions[bot] avatar Aug 29 '23 20:08 github-actions[bot]

📌 REPRODUCTION RESULTS

  • Tested on Simple – Replicated
  • Tested on Atomic – Replicated
  • Replicable outside of Dotcom – Yes/No

📌 FINDINGS/SCREENSHOTS/VIDEO Replicated across test sites. I think the .below-entry-meta is applying to images below the post's entry meta data, as shown here:

Screenshot on 2023-08-30 at 11-53-25

This seems like its intentional, to widen the content body below that first section of content in the post... but perhaps it's causing unintended consequences, or not making sense for customers?

Simple

https://github.com/Automattic/themes/assets/27249804/1d673dfe-92d0-4972-91f2-8de471120cb4

Self-Hosted

Markup on 2023-08-30 at 11:46:47

📌 ACTIONS

  • Triage complete
  • FYI @Automattic/theam
  • Added to Bug Scrub Planning

cuemarie avatar Aug 30 '23 19:08 cuemarie

6765538-zd Shared this CSS fix, which includes the image captions in the snippet.

body:not(.search-results) article:not(.type-page) figure.aligncenter img.below-entry-meta,
body:not(.search-results) article:not(.type-page) figure.below-entry-meta.aligncenter,
body:not(.search-results) article:not(.type-page) .wp-block-image figcaption.below-entry-meta {
    margin-left: 0;
}

danielk-am avatar Sep 04 '23 03:09 danielk-am

Another report here: 6761812-ZD

AnjanaV93 avatar Sep 11 '23 07:09 AnjanaV93

6798174-ZD tested this on my test site as well with the same exact content as the user.

laragee6 avatar Sep 12 '23 03:09 laragee6

New case here: 6752201-zen I noticed the class below-entry-meta that added -40% of margin-left on the img element.

louinel avatar Sep 13 '23 19:09 louinel

7070495-zen one more!

aetta avatar Sep 22 '23 13:09 aetta

7082359-ZD The CSS fix worked for this site.

wiesenhauss avatar Sep 25 '23 16:09 wiesenhauss

Isn't this the intended behaviour of the theme? It's the "Overhanging Full-Size Image" feature. image

AlexanderSky avatar Oct 07 '23 12:10 AlexanderSky

Isn't this the intended behaviour of the theme? It's the "Overhanging Full-Size Image" feature.

@AlexanderSky Since the theme indicates that overhang is for full-sized images wider than 840px, that implies that smaller-than-840px which are not full-width should not overhang - they should be contained within the same content margins as the rest of the content.

So in this issue, smaller-width images that are not full-width and are center-aligned are overhanging - which I believe is the unexpected behavior.

cuemarie avatar Oct 09 '23 20:10 cuemarie

also reported here 7186086-zen

laragee6 avatar Oct 19 '23 07:10 laragee6

Another report in 7268524-zd-a8c. Gave some alternate CSS as a fix (as the CSS above seems to just be left-aligning within the content area now).

body:not(.search-results) article:not(.type-page) figure.aligncenter.is-resized img.below-entry-meta,
body:not(.search-results) article:not(.type-page) figure.below-entry-meta.aligncenter.is-resized,
body:not(.search-results) article:not(.type-page) .wp-block-image .is-resized figcaption.wp-element-caption.below-entry-meta {
    margin-left: auto;
    margin-right: auto;
}

jp-imagines avatar Nov 14 '23 16:11 jp-imagines

Another report: 7539540-zen

AnjanaV93 avatar Jan 06 '24 09:01 AnjanaV93

This is an issue with the theme itself. A related issue can be found here: https://github.com/Automattic/themes/issues/7962

I raised it to WP core in: https://core.trac.wordpress.org/ticket/61723#comment:8

gikaragia avatar Sep 03 '24 15:09 gikaragia