When using the blazy filter on a CKE field containing an image that it is aligned to the center, the image is not aligned correctly.
That's because the align-center class is moved from the img tag to the wrapper.

Before:

<img alt="Test" data-entity-type="file" data-entity-uuid="9ba42395-fd06-49c8-a909-745714fc38dd" src="/system/files/inline-images/Capture%20du%202019-09-25%2011-26-03.png" class="align-center">

After:

<div class="media-wrapper media-wrapper--blazy align-center">            <div class="media media--blazy  media--image">
      
      
      

<!-- THEME DEBUG -->
<!-- THEME HOOK: 'image' -->
<!-- BEGIN OUTPUT from 'core/themes/classy/templates/field/image.html.twig' -->
<img alt="Test" title="Capture du 2019-09-25 11-26-03.png" class="media__image media__element b-lazy b-loaded" loading="lazy" src="/system/files/inline-images/Capture%20du%202019-09-25%2011-26-03.png" typeof="foaf:Image" data-bio-hit="1" width="452" height="126"><!-- END OUTPUT from 'core/themes/classy/templates/field/image.html.twig' --></div>
      </div>

The attached patch adds some CSS that fixes the issue.

CommentFileSizeAuthor
blazy-img_align_center.patch355 bytesprudloff

Comments

prudloff created an issue. See original summary.

gausarts’s picture

Thank you!
Please allow some delay to get back to this.

gausarts’s picture

Sorry, wrong room.

  • gausarts committed fc15349 on 8.x-2.x authored by prudloff
    Issue #3118712 by prudloff: Images are not centered correctly
    
gausarts’s picture

Status: Needs review » Fixed

Committed. Thank you for contribution!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.