Replies: 1 comment
-
|
This is a great callout! I think we need to be able to pass in custom attributes to blocks, as we haven't seen any recommendations from Shopify eg Right now, I'm looking at leaving certain settings on the section instead of moving to the most appropriate block, so that we can still do I don't think accessing the parent blocks settings would always work, for eg, this is one structure we're looking at;
Where the column count would ideally be on the product grid block, but would need to be accessible on the product image block to set the most appropriate sizing |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Theme blocks being re-usable piece of code, a theme block can't always know the context in which it is added and used. This is causing issues whenever a theme block is using images. Let's say we have a simple "image" theme block:
This is nice and make it reusable. However, the problem is coming from the sizes attribute. We have no context and it is impossible to know which value to pass. There is a recent
sizes="auto"addition to HTML spec, but the issue is that it requires the usage ofloading="lazy", which is not recommended when the image is above the fold.What is Shopify recommendation around this problem?
Beta Was this translation helpful? Give feedback.
All reactions