theme-shopify-section-structure
Shopify theme section structure, file organization, and schema requirements. Use when creating or modifying Shopify theme sections.
How do I install this agent skill?
npx skills add https://github.com/niccos-shopify-workspace/shopify-cursor-skills --skill theme-shopify-section-structureIs this agent skill safe to install?
- Gen Agent Trust Hubpass
This skill provides standard architectural guidelines and code templates for Shopify theme development. It defines best practices for section structure, schema configuration, and file organization using official Shopify documentation as a reference. No security issues or malicious patterns were detected.
- Socketpass
No alerts
- Snykpass
Risk: LOW · No issues
- Runlayerwarn
2/2 files flagged
What does this agent skill do?
Shopify Section Structure
Guidelines for organizing Shopify theme sections with proper file structure, schema configuration, and padding settings.
When to Use
- Creating new Shopify theme sections
- Modifying existing section schemas
- Setting up section file structure (Liquid, CSS, JS)
- Adding padding controls to sections
Section File Structure
Each section must have:
- Liquid section file (
.liquidinsections/directory) - Separate CSS file (in
assets/directory) - Optional separate JS file (in
assets/directory)
CSS Inclusion
Each section must include its own stylesheet using:
{{ 'section-name.css' | asset_url | stylesheet_tag }}
Important: Do NOT mix styles of multiple sections in one file. Each section has its own CSS file.
Exception: above-the-fold sections (e.g., header, announcement bar) can use styles from global theme files (like theme.css) to load critical CSS.
JavaScript Inclusion
If a section needs JavaScript, include it separately:
<script src="{{ 'section-logic.js' | asset_url }}" defer="defer"></script>
Section Schema Requirements
Every section schema MUST include padding settings.
Required Padding Settings
Add a "Paddings" heading in the schema with these settings:
{
"type": "header",
"content": "Paddings"
},
{
"type": "range",
"id": "padding_top",
"label": "Padding Top",
"min": 0,
"max": 100,
"step": 1,
"unit": "px",
"default": 0
},
{
"type": "range",
"id": "padding_bottom",
"label": "Padding Bottom",
"min": 0,
"max": 100,
"step": 1,
"unit": "px",
"default": 0
},
{
"type": "range",
"id": "padding_top_mobile",
"label": "Padding Top (Mobile)",
"min": 0,
"max": 100,
"step": 1,
"unit": "px",
"default": 0
},
{
"type": "range",
"id": "padding_bottom_mobile",
"label": "Padding Bottom (Mobile)",
"min": 0,
"max": 100,
"step": 1,
"unit": "px",
"default": 0
}
Schema Best Practices
- Add additional settings only when required
- Avoid over-configuring the schema
- Always include at least one preset
- Keep settings organized and logical
Applying Padding in CSS
Use the schema settings in your section CSS:
.section-{{ section.id }}-padding {
padding-top: {{ section.settings.padding_top }}px;
padding-bottom: {{ section.settings.padding_bottom }}px;
}
@media (max-width: 749px) {
.section-{{ section.id }}-padding {
padding-top: {{ section.settings.padding_top_mobile }}px;
padding-bottom: {{ section.settings.padding_bottom_mobile }}px;
}
}
Shopify Theme Documentation
Reference these official Shopify resources:
Example Section Structure
sections/
└── featured-collection.liquid
assets/
├── featured-collection.css
└── featured-collection.js (optional)
Instructions
- Create section file in
sections/directory with.liquidextension - Create CSS file in
assets/directory matching section name - Include CSS in section using
stylesheet_tagfilter - Add schema with required padding settings
- Add at least one preset to the schema
- Keep files separate - never mix multiple sections' styles in one CSS file
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/niccos-shopify-workspace/shopify-cursor-skills/theme-shopify-section-structure">View theme-shopify-section-structure on skillZs</a>