Skip to content
Cartly Developers

Clarity Theme

Clarity is Cartly's editorial default theme — a premium, fully i18n-ready design with filter-rail PLP, sticky PDP, AJAX Quick-Add, wishlist, and polymorphic article templates. This guide covers the theme architecture, design tokens, i18n keys, and how to fork files in the code editor.

Overview

Clarity is the canonical reference theme shipped with the Cartly platform. It is the default catalogue entry in the AppStore — new shops launched from the marketplace onboarding receive Linen as their install template (safe defaults, minimal complexity), while Clarity represents the aspirational full-featured editorial experience available one click away in AppStore → Themes.

Key headline capabilities:

  • Filter-rail PLP — faceted sidebar with Typesense-backed real-time filtering, active-filter chips, sort dropdown, and mobile filter-sheet drawer.
  • Sticky-info PDP — product info column scrolls with the page while the media gallery stays fixed above the fold. Bundles, reviews, and recently-viewed sections ship out of the box.
  • AJAX Quick-Add — product cards on collection and featured-collection sections include a Quick-Add button that opens a variant drawer without navigating away.
  • Wishlist with auth-gate — heart buttons trigger a login-required modal for guests; authenticated customers save products to their account wishlist.
  • Polymorphic article / blog templates — article pages include a related-articles section and share meta. Blog listing supports category filtering.
  • Themed 404 — two-column hero with a help band, so lost visitors see branded content instead of a blank error screen.
  • Full i18n — all customer-facing strings go through the {{ 'key' | t }} filter. Seven locales shipped: en, de, es, fr, ru, uk, he.

Clarity is registered in the marketplace as slug theme-clarity via cmd/seed-marketplace-themes and featured on the AppStore themes home page.

Theme Architecture

Clarity follows the standard Cartly three-layer resolver architecture. Files live in the platform embed FS under backend/internal/theme/templates/themes/clarity/. A DB row is created only when a merchant explicitly edits a file (fork-on-write). Stock files receive platform updates automatically on the next deploy.

bash
backend/internal/theme/templates/themes/clarity/
├── assets/
│   └── theme.css          # CSS custom properties (design tokens)
├── config/
│   ├── settings_schema.json
│   └── settings_data.json
├── layouts/
│   └── theme.liquid        # HTML shell — loads CSS, injects content_for_layout
├── locales/
│   ├── en.default.json
│   ├── de.json
│   ├── es.json
│   ├── fr.json
│   ├── ru.json
│   ├── uk.json
│   └── he.json
├── sections/
│   ├── announcement-bar.liquid
│   ├── header.liquid
│   ├── footer.liquid
│   ├── hero.liquid
│   ├── main-product.liquid          # Sticky-info PDP
│   ├── main-collection.liquid       # Filter-rail PLP
│   ├── main-cart.liquid
│   ├── main-search.liquid
│   ├── main-article.liquid
│   ├── main-blog.liquid
│   ├── main-page.liquid
│   ├── main-404.liquid
│   ├── main-customer-login.liquid
│   ├── featured-collection.liquid
│   ├── product-recommendations.liquid
│   ├── recently-viewed.liquid
│   ├── product-reviews.liquid
│   ├── bundle-items.liquid
│   ├── image-with-text.liquid
│   ├── rich-text.liquid
│   ├── video.liquid
│   ├── collapsible-content.liquid
│   ├── newsletter.liquid
│   └── ... (30+ sections total)
├── snippets/
│   ├── product-card.liquid
│   ├── quick-add.liquid            # AJAX Quick-Add drawer
│   ├── wishlist-button.liquid      # Auth-gated wishlist
│   ├── price.liquid
│   ├── breadcrumbs.liquid
│   └── ...
└── templates/
    ├── index.json
    ├── product.json
    ├── collection.json
    ├── cart.json
    ├── search.json
    ├── blog.json
    ├── article.json
    ├── page.json
    ├── 404.json
    ├── customers/login.json
    └── ...

The layouts/theme.liquid file is the HTML shell. It loads design token CSS, sets lang and dir attributes from {{ request.locale }}, and renders {{ content_for_layout }} where the active template section outputs its HTML.

Sections & Snippets

Every page template references one or more sections from sections/*.liquid. Notable sections:

Section fileDescription
main-collection.liquidFilter-rail PLP with faceted sidebar, sort, active-filter chips, and pagination
main-product.liquidSticky-info PDP: media gallery + sticky product info column
bundle-items.liquidFrequently-bought-together bundle add-to-cart on PDP
product-reviews.liquidReview list + submission form (requires Reviews feature enabled)
recently-viewed.liquidClient-side recently-viewed product carousel (localStorage-backed)
main-search.liquidSearch results page with faceted filtering, same rail as PLP
main-article.liquidBlog article with structured data, share buttons, and related-articles band
main-404.liquidThemed 404: two-column hero + help-links band
main-customer-login.liquidCustomer login form served by Liquid (part of Customer Account on Liquid)

Snippets are partial Liquid files included via {% render 'snippet-name' %}. The most-used snippets:

  • product-card.liquid — standardised card used across collection, featured-collection, recently-viewed, and search sections. Accepts a product object and an optional show_quick_add boolean.
  • quick-add.liquid — renders the Quick-Add button and loads the JS drawer component (see code example below).
  • wishlist-button.liquid — heart icon that triggers login modal for guests and calls the wishlist API for authenticated customers.
  • price.liquid — formats regular / compare-at price pairs with sale badges using the | money filter.
liquid
{%- comment -%}
  snippets/quick-add.liquid
  Renders a Quick-Add button that opens an AJAX drawer.
  Requires: product (the product object), section_id
{%- endcomment -%}

<quick-add-button
  class="clarity-quick-add"
  data-product-handle="{{ product.handle }}"
  data-section-id="{{ section_id }}"
>
  <button
    type="button"
    class="btn btn--secondary btn--sm"
    aria-label="{{ 'products.product.quick_add' | t }}: {{ product.title | escape }}"
    {% if product.available == false %}disabled{% endif %}
  >
    {{- 'products.product.quick_add' | t -}}
  </button>
</quick-add-button>

{{- 'quick-add.js' | asset_url | script_tag -}}

Design Tokens

Clarity's visual language is defined as CSS custom properties in assets/theme.css. The Visual Editor sidebar exposes these via the settings_schema.json color and font pickers — merchants override tokens without touching code. Developers who need programmatic access can read current values from config/settings_data.json (resolved at render time into the Liquid {{ settings }} object).

css
/* Clarity design tokens — defined in assets/theme.css
   Override via Admin → Online Store → Customize → Theme settings */

:root {
  /* Typography */
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body:    'Inter', system-ui, sans-serif;

  /* Palette */
  --color-primary:          #1a1a2e;
  --color-primary-hover:    #16213e;
  --color-accent:           #c9a96e;     /* warm gold */
  --color-background:       #ffffff;
  --color-surface:          #fafaf8;     /* slightly warm off-white */
  --color-text:             #1a1a2e;
  --color-text-muted:       #6b7280;
  --color-border:           #e5e7eb;

  /* Spacing */
  --spacing-section:  5rem;
  --spacing-gap:      1.5rem;

  /* Border radius */
  --radius-button:    0.25rem;
  --radius-card:      0.5rem;
  --radius-image:     0.75rem;
}

The warm-gold accent (#c9a96e) is the primary brand colour for call-to-action buttons and highlights. The editorial tone is reinforced by Playfair Display for headings and Inter for body copy — both loaded via Google Fonts with font-display: swap.

i18n Keys

All customer-facing strings are externalised to locales/en.default.json. Companion files provide translations for de, es, fr, ru, uk, he. Use the {{ 'key' | t }} filter in any Liquid file. Variable interpolation uses {{ count: n }}-style hash syntax.

javascript
// Clarity exposes all customer-facing strings via the | t filter.
// Add keys to locales/en.default.json and companion locale files.
// Key structure: section_id.setting_or_label

// Product / PDP
"products.product.add_to_cart"             // "Add to cart"
"products.product.sold_out"                // "Sold out"
"products.product.unavailable"             // "Unavailable"
"products.product.quantity"                // "Quantity"
"products.product.sku"                     // "SKU"
"products.product.vendor"                  // "Brand"
"products.product.view_full_details"       // "View full details"
"products.product.quick_add"               // "Quick add"

// Cart
"cart.general.title"                       // "Your cart"
"cart.general.empty"                       // "Your cart is empty"
"cart.general.continue_shopping"           // "Continue shopping"
"cart.general.checkout"                    // "Checkout"

// Collection / Filters
"collections.sorting.featured"             // "Featured"
"collections.sorting.price_asc"            // "Price: low to high"
"collections.sorting.price_desc"           // "Price: high to low"
"collections.filters.clear_all"            // "Clear all"
"collections.filters.apply"                // "Apply"

// Search
"search.placeholder"                       // "Search"
"search.results_with_count"               // "{{ count }} results for {{ terms }}"
"search.no_results"                        // "No results for {{ terms }}"

// Customer / Account
"customer.account.title"                   // "My account"
"customer.account.sign_out"                // "Sign out"
"customer.login.title"                     // "Log in"
"customer.register.title"                  // "Create account"

// 404
"general.404.title"                        // "Page not found"
"general.404.body"                         // "This page doesn't exist."
"general.404.shop_now"                     // "Shop now"

When adding a new locale file, copy en.default.json as a baseline and translate all values. The .default suffix on the English file marks it as the fallback — missing keys in other locales fall through to English automatically.

Forking in the Code Editor

Clarity follows the same fork-on-write model as every other Cartly theme. The code editor (Admin → Online Store → Themes → Edit Code) shows three file states:

  • Synced — stock file from the platform embed. Platform updates arrive automatically.
  • Custom — merchant has saved an edit. A DB row exists. Use "Compare with original" to diff against the current embed version.
  • New — merchant-created file with no embed counterpart.
javascript
// Open the Clarity code editor in the admin:
// Admin → Online Store → Themes → Edit Code

// To customize a section (e.g. sections/hero.liquid):
// 1. Click "sections/hero.liquid" — opens read-only with blue banner.
// 2. Click "Edit file" → confirm fork in the modal.
// 3. Make changes and save. A DB row is created (fork-on-write).
// 4. The amber "Upstream updated" banner appears if Cartly ships
//    a new version of the same file later — review the diff before syncing.

// To reset to the platform version:
// Click "Revert to default" — deletes the DB row, returns to embed version.

// To add a brand-new section:
// Click "+" → Section → enter name → scaffold is generated with
// full Liquid markup, five typed settings, and a preset.

When the platform ships a new version of a Clarity section that a merchant has already forked, an amber This file has been updated upstream banner appears. Merchants can review the diff and decide whether to sync or keep their customisation.

Theme Source

The canonical source lives in the platform repository at:

backend/internal/theme/templates/themes/clarity/

Clarity is the recommended reference when building a new theme from scratch — it exercises the full Cartly theme API: section groups, alternate templates, wishlist, Quick-Add, faceted filtering, Customer Account on Liquid, and the | t i18n filter across all seven supported locales. See Theme Development guide for the complete section schema reference and fork-on-write architecture.

The AppStore listing for Clarity is managed via cmd/seed-marketplace-themes (slug: theme-clarity). The listing is featured on the AppStore themes page.