This repository has been archived by the owner on Jul 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 95
theme-check-disable does not work for ImgWidthAndHeight #242
Labels
bug
Something isn't working
Comments
Thanks for the bug report! Looks like a bug in the disable/enable logic for regex based checks. In the meantime, you should be able to do the following to prevent layout shift in your theme: <img
class="list-view-item__image"
src="{{ product.featured_media | img_url: '95x95', scale: 2 }}"
alt="{{ product.featured_media.alt }}"
width="95"
height="95"
/> |
Thank @charlespwd , but hardcode the width and height in this case seems risky to me because img_url preserves the original aspect ratio. So when the original image is not a square the result would look distorted. Or am i missing something? |
In this case, I believe featured_media.width + height would do! <img
class="list-view-item__image"
src="{{ product.featured_media | img_url: '95x95', scale: 2 }}"
alt="{{ product.featured_media.alt }}"
width="{{ product.featured_media.width }}"
height="{{ product.featured_media.height }}"
/> Side note: That's what I actually put in before the edit 😅. I saw 95x95 and forgot about that the AR is maintained. I'm more used to the |
charlespwd
added a commit
that referenced
this issue
Apr 20, 2021
charlespwd
added a commit
that referenced
this issue
Apr 21, 2021
charlespwd
added a commit
that referenced
this issue
Apr 21, 2021
charlespwd
added a commit
that referenced
this issue
Apr 21, 2021
Fixed in 0.8.1.
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
In snippets/product-card-list.liquid i have
When i run
theme-check .
i still get for this file this error:The text was updated successfully, but these errors were encountered: