New advertisers: 50% off your first month with code FIRSTMONTHSee slots
benjaminsehl avatar

Liquid Theme Standards

Coding standards for Shopify Liquid themes covering BEM naming, design tokens, defensive CSS, and Web Components.

skills.sh installs
3.2K
GitHub stars
123
last updated
Aug 21, 2026
View on GitHub

What it does

  • Covers CSS, JavaScript, and HTML conventions for theme code in .liquid files and theme asset files
  • Specifies where styles live: {% stylesheet %} for scoped CSS, {% style %} for Liquid-driven values, and assets/*.css for shared styles
  • Enforces BEM naming, single-level elements, specificity limits of 0 1 0 to 0 4 0, and no IDs, element selectors, or !important
  • Designed for theme developers who write CSS, JS, and HTML inside Liquid templates and need consistent, progressive-enhancement patterns

Install

$ npx -y skills add benjaminsehl/liquid-skills --skill liquid-theme-standards -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

CSS, JS & HTML Standards for Shopify Liquid Themes

Core Principles

  1. Progressive enhancement — semantic HTML first, CSS second, JS third
  2. No external dependencies — native browser APIs only for JavaScript
  3. Design tokens — never hardcode colors, spacing, or fonts
  4. BEM naming — consistent class naming throughout
  5. Defensive CSS — handle edge cases gracefully

CSS in Liquid Themes

Where CSS Lives

LocationLiquid?Use For
{% stylesheet %}NoComponent-scoped styles (one per file)
{% style %}YesDynamic values needing Liquid (e.g., color settings)
assets/*.cssNoShared/global styles

Critical: {% stylesheet %} does NOT process Liquid. Use inline style attributes for dynamic values:

{%- comment -%} Do: inline variables {%- endcomment -%}
<div
  class="hero"
  style="--bg-color: {{ section.settings.bg_color }}; --padding: {{ section.settings.padding }}px;"
>

{%- comment -%} Don't: Liquid inside stylesheet {%- endcomment -%}
{% stylesheet %}
  .hero { background: {{ section.settings.bg_color }}; } /* Won't work */
{% endstylesheet %}

Details

Repository
github.com/benjaminsehl/liquid-skills
Category
Frontend & UI Code

More from benjaminsehl/liquid-skills

All 3

Similar to Liquid Theme Standards

More Frontend & UI Code