Replies: 3 comments 5 replies
-
Hey @bakura10, you can actually opt out of having a wrapping element by adding
Unless I'm misunderstanding and you had done that already 🤔 |
Beta Was this translation helpful? Give feedback.
-
Ah yeah I miss this. But this should then be the default as I will basically need to do that for all blocks. I think Shopify could abstract it and keep the wrapper (the wrapper has the benefit that you don’t have to output block.shopify_attributes yourself) but do not output the wrapper if nothing is rendered in the block |
Beta Was this translation helpful? Give feedback.
-
Another perspective here -- what I feel like this overlaps with is how sections/blocks/themes handle placeholder content, ie. what gets rendered when the intended content is not set. Maybe a pattern that could be defined here to handle this case + all other placeholder content cases? |
Beta Was this translation helpful? Give feedback.
-
Hi :),
As of today, if a block does not output anything, it will still output in the DOM the wrapper:
Especially with settings bounded to metafields that might be empty, this will generate a lot of empty DOM elements:
We often use the sibling selector in CSS, and this basically breaks it.
Beta Was this translation helpful? Give feedback.
All reactions