I was wondering if styling a section element is possible? If not I would think to put a div inside of the section but with blocks Shopify removes this element and puts the blocks in the section?
It depends on what exactly you want to do. So if you have the CSS file and just target the class of the section, then it will work. But if you use a custom attribute or an id, then it won't work, because custom attributes will be removed from the section and id's overwritten
Hi Jonas, I have a section with blocks in it. I want the blocks to have padding around them, as an option in the Shopify customiser. But when I do that, the middle has double padding, so I would like to use css grid-gap on the section instead. I have included some screenshots of the design
Ah understand! Then i would apply it to the block wrapper. And add the settings to the section itself. For example a li-settings:custom with a number setting: {
"type": "number",
"id": "gap",
"label": "Gap",
"default": 20
}
and the on the block wrapper element a attribute style="gap: {{section.settings.gap}};"