Custom sections
A new section is a new file insections/. Shopify picks it up automatically — there
is no registration step.
A minimal section
Rules
Use the design tokens
Use the container class
The theme has a.container class that handles the max width and the responsive
gutters. Use it rather than rolling your own.
Use section.shopify_attributes
On the section root element. It is what lets the theme editor and app extensions
target your section.
Use block.shopify_attributes
On every block wrapper. Same reason.
Scope your styles
Put the styles in a <style> block
{% style %} tag is Shopify’s way of letting the theme editor move section CSS
into a global stylesheet. It is the correct choice for a section.
Adding it to a template
Open the template in the theme editor and click Add section. Your new section appears in the list automatically. You do not need to edit any JSON.If you want the section available in a template by default, you can add it to
templates/*.json. But be aware that rebuilding a template from JSON can drop
blocks the merchant has configured. Prefer adding sections through the editor.Making it upgrade-safe
A worked example
A “Press & awards” section with a logo row.Code reference
The token system and the file map.
Performance
The budgets your section has to fit inside.
