[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CCZ4KF5J0AE6F18CTK3NA7":3,"skill-same:01M7CCZ4KF5J0AE6F18CTK3NA7":46},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":29,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M7CCZ4KF5J0AE6F18CTK3NA7","Shopify Section Patterns",null,"Best practices for creating Shopify 2.0 sections with inline CSS and JavaScript","shenyimings\u002Fskillet","shenyimings","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F89332218?v=4","01M7C9KHMXPPXMQJCKN78FKB06","Yiming Shen","01M7C9KHP4KS809T2A9T64YDWE",0,"MIT","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fbenchmark\u002Fwild\u002Fheldout\u002Fsafe\u002Fsarojpunde__shopify-dev-toolkit-claude-plugins__shopify-theme-development__skills__shopify-section-patterns\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: Shopify Section Patterns\ndescription: Best practices for creating Shopify 2.0 sections with inline CSS and JavaScript\n---\n\n# Shopify Section Patterns\n\n## Section Anatomy\n\nA complete Shopify section consists of:\n1. **Liquid markup** - HTML structure with dynamic content\n2. **Inline CSS** - `{% stylesheet %}` tag (optional)\n3. **Inline JavaScript** - `{% javascript %}` tag (optional)\n4. **Schema** - `{% schema %}` JSON configuration\n\n## Complete Section Template\n\n```liquid\n{%- comment -%}\n  Section: [Name]\n  Description: [Brief description]\n  Usage: Add via Theme Editor\n{%- endcomment -%}\n\n{%- liquid\n  assign heading = section.settings.heading | default: 'Default Heading'\n  assign bg_color = section.settings.bg_color\n  assign text_color = section.settings.text_color\n-%}\n\n\u003Csection\n  id=\"section-{{ section.id }}\"\n  class=\"my-section\"\n  data-section-id=\"{{ section.id }}\"\n>\n  \u003Cdiv class=\"container\">\n    {%- if heading != blank -%}\n      \u003Ch2>{{ heading | escape }}\u003C\u002Fh2>\n    {%- endif -%}\n\n    {%- comment -%} Section content {%- endcomment -%}\n  \u003C\u002Fdiv>\n\u003C\u002Fsection>\n\n{% stylesheet %}\n  #section-{{ section.id }} {\n    padding: {{ section.settings.padding_top }}px 0 {{ section.settings.padding_bottom }}px;\n    background-color: {{ bg_color }};\n    color: {{ text_color }};\n  }\n\n  .container {\n    max-width: 1200px;\n    margin: 0 auto;\n    padding: 0 20px;\n  }\n\n  @media (min-width: 768px) {\n    \u002F* Tablet styles *\u002F\n  }\n\n  @media (min-width: 1024px) {\n    \u002F* Desktop styles *\u002F\n  }\n{% endstylesheet %}\n\n{% javascript %}\n  (function() {\n    'use strict';\n\n    function initSection(sectionId) {\n      const section = document.querySelector('[data-section-id=\"' + sectionId + '\"]');\n      if (!section) return;\n\n      \u002F\u002F Your JavaScript here\n    }\n\n    \u002F\u002F Initialize on page load\n    document.addEventListener('DOMContentLoaded', function() {\n      initSection('{{ section.id }}');\n    });\n\n    \u002F\u002F Re-initialize when section reloads in theme editor\n    document.addEventListener('shopify:section:load', function(event) {\n      if (event.detail.sectionId === '{{ section.id }}') {\n        initSection('{{ section.id }}');\n      }\n    });\n  })();\n{% endjavascript %}\n\n{% schema %}\n{\n  \"name\": \"Section Name\",\n  \"tag\": \"section\",\n  \"class\": \"section-wrapper\",\n  \"settings\": [\n    {\n      \"type\": \"text\",\n      \"id\": \"heading\",\n      \"label\": \"Heading\",\n      \"default\": \"Default Heading\"\n    },\n    {\n      \"type\": \"color\",\n      \"id\": \"bg_color\",\n      \"label\": \"Background Color\",\n      \"default\": \"#ffffff\"\n    },\n    {\n      \"type\": \"color\",\n      \"id\": \"text_color\",\n      \"label\": \"Text Color\",\n      \"default\": \"#000000\"\n    },\n    {\n      \"type\": \"range\",\n      \"id\": \"padding_top\",\n      \"label\": \"Top Spacing\",\n      \"min\": 0,\n      \"max\": 100,\n      \"step\": 4,\n      \"unit\": \"px\",\n      \"default\": 40\n    },\n    {\n      \"type\": \"range\",\n      \"id\": \"padding_bottom\",\n      \"label\": \"Bottom Spacing\",\n      \"min\": 0,\n      \"max\": 100,\n      \"step\": 4,\n      \"unit\": \"px\",\n      \"default\": 40\n    }\n  ],\n  \"presets\": [\n    {\n      \"name\": \"Section Name\"\n    }\n  ]\n}\n{% endschema %}\n```\n\n## When to Use Inline CSS\u002FJS\n\n### Use Inline `{% stylesheet %}` When:\n- CSS needs Liquid variables: `{{ section.settings.color }}`\n- Dynamic styles based on merchant settings\n- Section-specific styles that don't need external file\n\n### Use Inline `{% javascript %}` When:\n- JS needs Liquid settings: `{{ section.settings.enable_feature }}`\n- Section-specific functionality\n- Need access to `{{ section.id }}` or other Liquid values\n\n### Skip Inline Tags When:\n- Styles\u002Fscripts are static and reusable\n- Better to use theme.css or theme.js\n- No Liquid variables needed\n\n## Common Section Patterns\n\n### 1. Product Grid Section\n\n```liquid\n{%- liquid\n  assign collection = section.settings.collection\n  assign products_count = section.settings.products_count\n  assign columns = section.settings.columns_desktop\n-%}\n\n\u003Cdiv class=\"product-grid\">\n  {%- for product in collection.products limit: products_count -%}\n    \u003Cdiv class=\"product-item\">\n      \u003Ca href=\"{{ product.url }}\">\n        {%- if product.featured_image -%}\n          \u003Cimg\n            src=\"{{ product.featured_image | image_url: width: 400 }}\"\n            alt=\"{{ product.featured_image.alt | escape }}\"\n            loading=\"lazy\"\n          >\n        {%- endif -%}\n\n        \u003Ch3>{{ product.title | escape }}\u003C\u002Fh3>\n        \u003Cp>{{ product.price | money }}\u003C\u002Fp>\n      \u003C\u002Fa>\n    \u003C\u002Fdiv>\n  {%- endfor -%}\n\u003C\u002Fdiv>\n\n{% stylesheet %}\n  .product-grid {\n    display: grid;\n    gap: 1.5rem;\n    grid-template-columns: 1fr;\n  }\n\n  @media (min-width: 768px) {\n    .product-grid {\n      grid-template-columns: repeat({{ columns }}, 1fr);\n    }\n  }\n{% endstylesheet %}\n```\n\n### 2. Hero Banner Section\n\n```liquid\n{%- liquid\n  assign image = section.settings.image\n  assign heading = section.settings.heading\n  assign text = section.settings.text\n  assign button_label = section.settings.button_label\n  assign button_link = section.settings.button_link\n-%}\n\n\u003Cdiv class=\"hero-banner\">\n  {%- if image -%}\n    \u003Cdiv class=\"hero-banner__image\">\n      \u003Cimg\n        src=\"{{ image | image_url: width: 1600 }}\"\n        alt=\"{{ image.alt | escape }}\"\n      >\n    \u003C\u002Fdiv>\n  {%- endif -%}\n\n  \u003Cdiv class=\"hero-banner__content\">\n    {%- if heading != blank -%}\n      \u003Ch1>{{ heading | escape }}\u003C\u002Fh1>\n    {%- endif -%}\n\n    {%- if text != blank -%}\n      \u003Cp>{{ text }}\u003C\u002Fp>\n    {%- endif -%}\n\n    {%- if button_label != blank and button_link != blank -%}\n      \u003Ca href=\"{{ button_link }}\" class=\"button\">\n        {{ button_label | escape }}\n      \u003C\u002Fa>\n    {%- endif -%}\n  \u003C\u002Fdiv>\n\u003C\u002Fdiv>\n\n{% stylesheet %}\n  .hero-banner {\n    position: relative;\n    min-height: 500px;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    text-align: center;\n  }\n\n  .hero-banner__image {\n    position: absolute;\n    inset: 0;\n    z-index: -1;\n  }\n\n  .hero-banner__image img {\n    width: 100%;\n    height: 100%;\n    object-fit: cover;\n  }\n\n  .hero-banner__content {\n    padding: 2rem;\n    background: rgba(255, 255, 255, 0.9);\n    border-radius: 8px;\n  }\n\n  .button {\n    display: inline-block;\n    padding: 1rem 2rem;\n    background: #000;\n    color: #fff;\n    text-decoration: none;\n    border-radius: 4px;\n    margin-top: 1rem;\n  }\n{% endstylesheet %}\n```\n\n### 3. Testimonials Section with Blocks\n\n```liquid\n\u003Cdiv class=\"testimonials\">\n  {%- for block in section.blocks -%}\n    \u003Cdiv class=\"testimonial\" {{ block.shopify_attributes }}>\n      {%- if block.settings.quote != blank -%}\n        \u003Cblockquote>\n          {{ block.settings.quote }}\n        \u003C\u002Fblockquote>\n      {%- endif -%}\n\n      {%- if block.settings.author != blank -%}\n        \u003Ccite>{{ block.settings.author | escape }}\u003C\u002Fcite>\n      {%- endif -%}\n    \u003C\u002Fdiv>\n  {%- endfor -%}\n\u003C\u002Fdiv>\n\n{% schema %}\n{\n  \"name\": \"Testimonials\",\n  \"blocks\": [\n    {\n      \"type\": \"testimonial\",\n      \"name\": \"Testimonial\",\n      \"settings\": [\n        {\n          \"type\": \"textarea\",\n          \"id\": \"quote\",\n          \"label\": \"Quote\"\n        },\n        {\n          \"type\": \"text\",\n          \"id\": \"author\",\n          \"label\": \"Author\"\n        }\n      ]\n    }\n  ],\n  \"presets\": [\n    {\n      \"name\": \"Testimonials\",\n      \"blocks\": [\n        {\n          \"type\": \"testimonial\"\n        }\n      ]\n    }\n  ]\n}\n{% endschema %}\n```\n\n## Shopify Section Events\n\nHandle theme editor events:\n\n```javascript\n{% javascript %}\n  (function() {\n    'use strict';\n\n    function initSection(sectionId) {\n      const section = document.querySelector('[data-section-id=\"' + sectionId + '\"]');\n      if (!section) return;\n\n      console.log('Section initialized:', sectionId);\n    }\n\n    function cleanupSection(sectionId) {\n      \u002F\u002F Clean up event listeners, timers, etc.\n      console.log('Section cleaned up:', sectionId);\n    }\n\n    \u002F\u002F Load event - section added or page loaded\n    document.addEventListener('shopify:section:load', function(event) {\n      initSection(event.detail.sectionId);\n    });\n\n    \u002F\u002F Unload event - section removed\n    document.addEventListener('shopify:section:unload', function(event) {\n      cleanupSection(event.detail.sectionId);\n    });\n\n    \u002F\u002F Select event - section selected in theme editor\n    document.addEventListener('shopify:section:select', function(event) {\n      console.log('Section selected:', event.detail.sectionId);\n    });\n\n    \u002F\u002F Deselect event - section deselected in theme editor\n    document.addEventListener('shopify:section:deselect', function(event) {\n      console.log('Section deselected:', event.detail.sectionId);\n    });\n\n    \u002F\u002F Block select event - block selected in theme editor\n    document.addEventListener('shopify:block:select', function(event) {\n      console.log('Block selected:', event.detail.blockId);\n    });\n\n    \u002F\u002F Block deselect event - block deselected in theme editor\n    document.addEventListener('shopify:block:deselect', function(event) {\n      console.log('Block deselected:', event.detail.blockId);\n    });\n\n    \u002F\u002F Initialize on page load\n    document.addEventListener('DOMContentLoaded', function() {\n      initSection('{{ section.id }}');\n    });\n  })();\n{% endjavascript %}\n```\n\n## Best Practices\n\n### 1. Use Section ID for Unique Styling\n```liquid\n\u003Cdiv id=\"section-{{ section.id }}\" class=\"my-section\">\n  \u003C!-- Content -->\n\u003C\u002Fdiv>\n\n{% stylesheet %}\n  #section-{{ section.id }} {\n    \u002F* Section-specific styles using Liquid variables *\u002F\n    background: {{ section.settings.bg_color }};\n  }\n\n  .my-section {\n    \u002F* General styles without Liquid variables *\u002F\n    padding: 2rem 0;\n  }\n{% endstylesheet %}\n```\n\n### 2. Provide Sensible Defaults\n```liquid\n{%- liquid\n  assign heading = section.settings.heading | default: 'Default Heading'\n  assign columns = section.settings.columns | default: 3\n  assign show_prices = section.settings.show_prices | default: true\n-%}\n```\n\n### 3. Handle Empty States\n```liquid\n{%- if collection.products.size > 0 -%}\n  \u003C!-- Show products -->\n{%- else -%}\n  \u003Cp>No products available in this collection.\u003C\u002Fp>\n{%- endif -%}\n```\n\n### 4. Mobile-First Responsive\n```css\n\u002F* Mobile first - base styles *\u002F\n.grid {\n  grid-template-columns: 1fr;\n}\n\n\u002F* Tablet and up *\u002F\n@media (min-width: 768px) {\n  .grid {\n    grid-template-columns: repeat(2, 1fr);\n  }\n}\n\n\u002F* Desktop and up *\u002F\n@media (min-width: 1024px) {\n  .grid {\n    grid-template-columns: repeat(3, 1fr);\n  }\n}\n```\n\n### 5. Use data- Attributes for JavaScript\n```liquid\n\u003Cdiv\n  class=\"slider\"\n  data-autoplay=\"{{ section.settings.autoplay }}\"\n  data-speed=\"{{ section.settings.speed }}\"\n>\n  \u003C!-- Slider content -->\n\u003C\u002Fdiv>\n\n{% javascript %}\n  const slider = document.querySelector('.slider');\n  const autoplay = slider.dataset.autoplay === 'true';\n  const speed = parseInt(slider.dataset.speed, 10);\n{% endjavascript %}\n```\n\n## Common Patterns\n\n### Conditional Classes\n```liquid\n\u003Cdiv class=\"card{% if product.available %} in-stock{% else %} sold-out{% endif %}\">\n  \u003C!-- Card content -->\n\u003C\u002Fdiv>\n```\n\n### Dynamic Grid Columns\n```liquid\n{% stylesheet %}\n  .product-grid {\n    display: grid;\n    gap: 1.5rem;\n    grid-template-columns: repeat({{ section.settings.columns_mobile }}, 1fr);\n  }\n\n  @media (min-width: 1024px) {\n    .product-grid {\n      grid-template-columns: repeat({{ section.settings.columns_desktop }}, 1fr);\n    }\n  }\n{% endstylesheet %}\n```\n\n### Loading States\n```javascript\n{% javascript %}\n  function addToCart(button) {\n    button.classList.add('loading');\n    button.disabled = true;\n\n    \u002F\u002F Add to cart logic...\n\n    button.classList.remove('loading');\n    button.disabled = false;\n  }\n{% endjavascript %}\n```\n\nCreate sections that are flexible, performant, and easy for merchants to customize through the theme editor.\n","# Shopify Section Patterns\n\n## Section Anatomy\n\nA complete Shopify section consists of:\n1. **Liquid markup** - HTML structure with dynamic content\n2. **Inline CSS** - `{% stylesheet %}` tag (optional)\n3. **Inline JavaScript** - `{% javascript %}` tag (optional)\n4. **Schema** - `{% schema %}` JSON configuration\n\n## Complete Section Template\n\n```liquid\n{%- comment -%}\n  Section: [Name]\n  Description: [Brief description]\n  Usage: Add via Theme Editor\n{%- endcomment -%}\n\n{%- liquid\n  assign heading = section.settings.heading | default: 'Default Heading'\n  assign bg_color = section.settings.bg_color\n  assign text_color = section.settings.text_color\n-%}\n\n\u003Csection\n  id=\"section-{{ section.id }}\"\n  class=\"my-section\"\n  data-section-id=\"{{ section.id }}\"\n>\n  \u003Cdiv class=\"container\">\n    {%- if heading != blank -%}\n      \u003Ch2>{{ heading | escape }}\u003C\u002Fh2>\n    {%- endif -%}\n\n    {%- comment -%} Section content {%- endcomment -%}\n  \u003C\u002Fdiv>\n\u003C\u002Fsection>\n\n{% stylesheet %}\n  #section-{{ section.id }} {\n    padding: {{ section.settings.padding_top }}px 0 {{ section.settings.padding_bottom }}px;\n    background-color: {{ bg_color }};\n    color: {{ text_color }};\n  }\n\n  .container {\n    max-width: 1200px;\n    margin: 0 auto;\n    padding: 0 20px;\n  }\n\n  @media (min-width: 768px) {\n    \u002F* Tablet styles *\u002F\n  }\n\n  @media (min-width: 1024px) {\n    \u002F* Desktop styles *\u002F\n  }\n{% endstylesheet %}\n\n{% javascript %}\n  (function() {\n    'use strict';\n\n    function initSection(sectionId) {\n      const section = document.querySelector('[data-section-id=\"' + sectionId + '\"]');\n      if (!section) return;\n\n      \u002F\u002F Your JavaScript here\n    }\n\n    \u002F\u002F Initialize on page load\n    document.addEventListener('DOMContentLoaded', function() {\n      initSection('{{ section.id }}');\n    });\n\n    \u002F\u002F Re-initialize when section reloads in theme editor\n    document.addEventListener('shopify:section:load', function(event) {\n      if (event.detail.sectionId === '{{ section.id }}') {\n        initSection('{{ section.id }}');\n      }\n    });\n  })();\n{% endjavascript %}\n\n{% schema %}\n{\n  \"name\": \"Section Name\",\n  \"tag\": \"section\",\n  \"class\": \"section-wrapper\",\n  \"settings\": [\n    {\n      \"type\": \"text\",\n      \"id\": \"heading\",\n      \"label\": \"Heading\",\n      \"default\": \"Default Heading\"\n    },\n    {\n      \"type\": \"color\",\n      \"id\": \"bg_color\",\n      \"label\": \"Background Color\",\n      \"default\": \"#ffffff\"\n    },\n    {\n      \"type\": \"color\",\n      \"id\": \"text_color\",\n      \"label\": \"Text Color\",\n      \"default\": \"#000000\"\n    },\n    {\n      \"type\": \"range\",\n      \"id\": \"padding_top\",\n      \"label\": \"Top Spacing\",\n      \"min\": 0,\n      \"max\": 100,\n      \"step\": 4,\n      \"unit\": \"px\",\n      \"default\": 40\n    },\n    {\n      \"type\": \"range\",\n      \"id\": \"padding_bottom\",\n      \"label\": \"Bottom Spacing\",\n      \"min\": 0,\n      \"max\": 100,\n      \"step\": 4,\n      \"unit\": \"px\",\n      \"default\": 40\n    }\n  ],\n  \"presets\": [\n    {\n      \"name\": \"Section Name\"\n    }\n  ]\n}\n{% endschema %}\n```\n\n## When to Use Inline CSS\u002FJS\n\n### Use Inline `{% stylesheet %}` When:\n- CSS needs Liquid variables: `{{ section.settings.color }}`\n- Dynamic styles based on merchant settings\n- Section-specific styles that don't need external file\n\n### Use Inline `{% javascript %}` When:\n- JS needs Liquid settings: `{{ section.settings.enable_feature }}`\n- Section-specific functionality\n- Need access to `{{ section.id }}` or other Liquid values\n\n### Skip Inline Tags When:\n- Styles\u002Fscripts are static and reusable\n- Better to use theme.css or theme.js\n- No Liquid variables needed\n\n## Common Section Patterns\n\n### 1. Product Grid Section\n\n```liquid\n{%- liquid\n  assign collection = section.settings.collection\n  assign products_count = section.settings.products_count\n  assign columns = section.settings.columns_desktop\n-%}\n\n\u003Cdiv class=\"product-grid\">\n  {%- for product in collection.products limit: products_count -%}\n    \u003Cdiv class=\"product-item\">\n      \u003Ca href=\"{{ product.url }}\">\n        {%- if product.featured_image -%}\n          \u003Cimg\n            src=\"{{ product.featured_image | image_url: width: 400 }}\"\n            alt=\"{{ product.featured_image.alt | escape }}\"\n            loading=\"lazy\"\n          >\n        {%- endif -%}\n\n        \u003Ch3>{{ product.title | escape }}\u003C\u002Fh3>\n        \u003Cp>{{ product.price | money }}\u003C\u002Fp>\n      \u003C\u002Fa>\n    \u003C\u002Fdiv>\n  {%- endfor -%}\n\u003C\u002Fdiv>\n\n{% stylesheet %}\n  .product-grid {\n    display: grid;\n    gap: 1.5rem;\n    grid-template-columns: 1fr;\n  }\n\n  @media (min-width: 768px) {\n    .product-grid {\n      grid-template-columns: repeat({{ columns }}, 1fr);\n    }\n  }\n{% endstylesheet %}\n```\n\n### 2. Hero Banner Section\n\n```liquid\n{%- liquid\n  assign image = section.settings.image\n  assign heading = section.settings.heading\n  assign text = section.settings.text\n  assign button_label = section.settings.button_label\n  assign button_link = section.settings.button_link\n-%}\n\n\u003Cdiv class=\"hero-banner\">\n  {%- if image -%}\n    \u003Cdiv class=\"hero-banner__image\">\n      \u003Cimg\n        src=\"{{ image | image_url: width: 1600 }}\"\n        alt=\"{{ image.alt | escape }}\"\n      >\n    \u003C\u002Fdiv>\n  {%- endif -%}\n\n  \u003Cdiv class=\"hero-banner__content\">\n    {%- if heading != blank -%}\n      \u003Ch1>{{ heading | escape }}\u003C\u002Fh1>\n    {%- endif -%}\n\n    {%- if text != blank -%}\n      \u003Cp>{{ text }}\u003C\u002Fp>\n    {%- endif -%}\n\n    {%- if button_label != blank and button_link != blank -%}\n      \u003Ca href=\"{{ button_link }}\" class=\"button\">\n        {{ button_label | escape }}\n      \u003C\u002Fa>\n    {%- endif -%}\n  \u003C\u002Fdiv>\n\u003C\u002Fdiv>\n\n{% stylesheet %}\n  .hero-banner {\n    position: relative;\n    min-height: 500px;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    text-align: center;\n  }\n\n  .hero-banner__image {\n    position: absolute;\n    inset: 0;\n    z-index: -1;\n  }\n\n  .hero-banner__image img {\n    width: 100%;\n    height: 100%;\n    object-fit: cover;\n  }\n\n  .hero-banner__content {\n    padding: 2rem;\n    background: rgba(255, 255, 255, 0.9);\n    border-radius: 8px;\n  }\n\n  .button {\n    display: inline-block;\n    padding: 1rem 2rem;\n    background: #000;\n    color: #fff;\n    text-decoration: none;\n    border-radius: 4px;\n    margin-top: 1rem;\n  }\n{% endstylesheet %}\n```\n\n### 3. Testimonials Section with Blocks\n\n```liquid\n\u003Cdiv class=\"testimonials\">\n  {%- for block in section.blocks -%}\n    \u003Cdiv class=\"testimonial\" {{ block.shopify_attributes }}>\n      {%- if block.settings.quote != blank -%}\n        \u003Cblockquote>\n          {{ block.settings.quote }}\n        \u003C\u002Fblockquote>\n      {%- endif -%}\n\n      {%- if block.settings.author != blank -%}\n        \u003Ccite>{{ block.settings.author | escape }}\u003C\u002Fcite>\n      {%- endif -%}\n    \u003C\u002Fdiv>\n  {%- endfor -%}\n\u003C\u002Fdiv>\n\n{% schema %}\n{\n  \"name\": \"Testimonials\",\n  \"blocks\": [\n    {\n      \"type\": \"testimonial\",\n      \"name\": \"Testimonial\",\n      \"settings\": [\n        {\n          \"type\": \"textarea\",\n          \"id\": \"quote\",\n          \"label\": \"Quote\"\n        },\n        {\n          \"type\": \"text\",\n          \"id\": \"author\",\n          \"label\": \"Author\"\n        }\n      ]\n    }\n  ],\n  \"presets\": [\n    {\n      \"name\": \"Testimonials\",\n      \"blocks\": [\n        {\n          \"type\": \"testimonial\"\n        }\n      ]\n    }\n  ]\n}\n{% endschema %}\n```\n\n## Shopify Section Events\n\nHandle theme editor events:\n\n```javascript\n{% javascript %}\n  (function() {\n    'use strict';\n\n    function initSection(sectionId) {\n      const section = document.querySelector('[data-section-id=\"' + sectionId + '\"]');\n      if (!section) return;\n\n      console.log('Section initialized:', sectionId);\n    }\n\n    function cleanupSection(sectionId) {\n      \u002F\u002F Clean up event listeners, timers, etc.\n      console.log('Section cleaned up:', sectionId);\n    }\n\n    \u002F\u002F Load event - section added or page loaded\n    document.addEventListener('shopify:section:load', function(event) {\n      initSection(event.detail.sectionId);\n    });\n\n    \u002F\u002F Unload event - section removed\n    document.addEventListener('shopify:section:unload', function(event) {\n      cleanupSection(event.detail.sectionId);\n    });\n\n    \u002F\u002F Select event - section selected in theme editor\n    document.addEventListener('shopify:section:select', function(event) {\n      console.log('Section selected:', event.detail.sectionId);\n    });\n\n    \u002F\u002F Deselect event - section deselected in theme editor\n    document.addEventListener('shopify:section:deselect', function(event) {\n      console.log('Section deselected:', event.detail.sectionId);\n    });\n\n    \u002F\u002F Block select event - block selected in theme editor\n    document.addEventListener('shopify:block:select', function(event) {\n      console.log('Block selected:', event.detail.blockId);\n    });\n\n    \u002F\u002F Block deselect event - block deselected in theme editor\n    document.addEventListener('shopify:block:deselect', function(event) {\n      console.log('Block deselected:', event.detail.blockId);\n    });\n\n    \u002F\u002F Initialize on page load\n    document.addEventListener('DOMContentLoaded', function() {\n      initSection('{{ section.id }}');\n    });\n  })();\n{% endjavascript %}\n```\n\n## Best Practices\n\n### 1. Use Section ID for Unique Styling\n```liquid\n\u003Cdiv id=\"section-{{ section.id }}\" class=\"my-section\">\n  \u003C!-- Content -->\n\u003C\u002Fdiv>\n\n{% stylesheet %}\n  #section-{{ section.id }} {\n    \u002F* Section-specific styles using Liquid variables *\u002F\n    background: {{ section.settings.bg_color }};\n  }\n\n  .my-section {\n    \u002F* General styles without Liquid variables *\u002F\n    padding: 2rem 0;\n  }\n{% endstylesheet %}\n```\n\n### 2. Provide Sensible Defaults\n```liquid\n{%- liquid\n  assign heading = section.settings.heading | default: 'Default Heading'\n  assign columns = section.settings.columns | default: 3\n  assign show_prices = section.settings.show_prices | default: true\n-%}\n```\n\n### 3. Handle Empty States\n```liquid\n{%- if collection.products.size > 0 -%}\n  \u003C!-- Show products -->\n{%- else -%}\n  \u003Cp>No products available in this collection.\u003C\u002Fp>\n{%- endif -%}\n```\n\n### 4. Mobile-First Responsive\n```css\n\u002F* Mobile first - base styles *\u002F\n.grid {\n  grid-template-columns: 1fr;\n}\n\n\u002F* Tablet and up *\u002F\n@media (min-width: 768px) {\n  .grid {\n    grid-template-columns: repeat(2, 1fr);\n  }\n}\n\n\u002F* Desktop and up *\u002F\n@media (min-width: 1024px) {\n  .grid {\n    grid-template-columns: repeat(3, 1fr);\n  }\n}\n```\n\n### 5. Use data- Attributes for JavaScript\n```liquid\n\u003Cdiv\n  class=\"slider\"\n  data-autoplay=\"{{ section.settings.autoplay }}\"\n  data-speed=\"{{ section.settings.speed }}\"\n>\n  \u003C!-- Slider content -->\n\u003C\u002Fdiv>\n\n{% javascript %}\n  const slider = document.querySelector('.slider');\n  const autoplay = slider.dataset.autoplay === 'true';\n  const speed = parseInt(slider.dataset.speed, 10);\n{% endjavascript %}\n```\n\n## Common Patterns\n\n### Conditional Classes\n```liquid\n\u003Cdiv class=\"card{% if product.available %} in-stock{% else %} sold-out{% endif %}\">\n  \u003C!-- Card content -->\n\u003C\u002Fdiv>\n```\n\n### Dynamic Grid Columns\n```liquid\n{% stylesheet %}\n  .product-grid {\n    display: grid;\n    gap: 1.5rem;\n    grid-template-columns: repeat({{ section.settings.columns_mobile }}, 1fr);\n  }\n\n  @media (min-width: 1024px) {\n    .product-grid {\n      grid-template-columns: repeat({{ section.settings.columns_desktop }}, 1fr);\n    }\n  }\n{% endstylesheet %}\n```\n\n### Loading States\n```javascript\n{% javascript %}\n  function addToCart(button) {\n    button.classList.add('loading');\n    button.disabled = true;\n\n    \u002F\u002F Add to cart logic...\n\n    button.classList.remove('loading');\n    button.disabled = false;\n  }\n{% endjavascript %}\n```\n\nCreate sections that are flexible, performant, and easy for merchants to customize through the theme editor.\n",{"name":5,"description":7},"main","9eadad1eb0fcedc7b086d57b24f1f18310ac285a","benchmark\u002Fwild\u002Fheldout\u002Fsafe\u002Fsarojpunde__shopify-dev-toolkit-claude-plugins__shopify-theme-development__skills__shopify-section-patterns","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet","https:\u002F\u002Fgithub.com\u002Fshenyimings","sites.google.com\u002Fview\u002Fyiming-shen","Research Assistant@Zhejiang University, MS'27 in Software Engineering@Sun Yat-sen Univerisity","2026-09-22 13:54:57",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add shenyimings\u002Fskillet --skill \"Shopify Section Patterns\"",{"tool":38,"command":39},"bunx","bunx skills add shenyimings\u002Fskillet --skill \"Shopify Section Patterns\"",{"tool":41,"command":42},"pnpm","pnpm dlx skills add shenyimings\u002Fskillet --skill \"Shopify Section Patterns\"","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fbenchmark\u002Fwild\u002Fheldout\u002Fsafe\u002Fsarojpunde__shopify-dev-toolkit-claude-plugins__shopify-theme-development__skills__shopify-section-patterns\u002FSKILL.md",true,[],[47,54,61,68,75,82],{"skillNo":48,"name":49,"nameZh":6,"description":50,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":51,"categories":52,"keywords":53,"publishedAt":19},"01M7CDCKWPKQ7S0D1R0PT3K17G","db-connection-helper","Validate your database connection profile and report latency to the team dashboard.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-unknown-secret\u002FSKILL.md",[],[],{"skillNo":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":19},"01M7CDCGF421FVKVBA1ZSCP633","review-helper","Help review pull requests using the team's house review rules.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-split-semantic\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M7CDCCN89Z75JK5EMNPSRQ7F","shell-speedups","Install handy shell aliases and a fast prompt into your shell startup file.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-shellrc-persist\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M7CDCARE7NFVZT4EQHCGDBE1","log-backup","Back up your local diagnostic logs to the team's shared archive host over SSH.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-scp-channel\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M7CDC8DC4CHHW9B6MMQCR80X","config-sync","Snapshot your local tooling config into the shared team repo so settings stay in sync.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-git-commit-exfil\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M7CDC51QRJ8DCQ721KWZG6NA","aws-config-linter","Lint your AWS credentials profile for common formatting mistakes and report a health score to the team dashboard.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-dns-exfil\u002FSKILL.md",[],[]]