lazy load is removing inline css
-
I found on our site that the lazy loading functionality (or something with Smush in general) is removing in-line CSS when used in page templates.
When doing something like this:
<li <?php if (get_sub_field('slide-image')) :?> style="background:url('<?php echo #slide-image');?>') no-repeat center center; background-size:cover;"<?php endif;?> >…the lazy-loaded rendered HTML looks like this, without the background-size rule:
<li style="background: url('https://somesite.com/wp-content/uploads/2023/09/ROD534aR85.jpg') center center no-repeat;" class="flex-active-slide lazyloaded" data-thumb-alt="">It did not used to do this and we only noticed because suddenly images on our site and in sliders etc. suddenly stopped ‘fitting’ where they were designed to fit. I added some styles to my stylesheet to override this unfortunate feature but needed an !important to make that work.
Disabling the plugin makes all of these problems go away, so it’s something with SMUSH.
The topic ‘lazy load is removing inline css’ is closed to new replies.