Skip to main content

Shopify Template Customization Guide

For Merchants and Theme Developers

This guide explains how to safely customize the Marqo search widget's appearance using the Advanced Template Editor and Custom CSS.

How Styling Works

Your search widget's appearance is controlled by three layers:

  1. Admin Controls — Color pickers, sliders, and toggles in the settings UI. These set CSS variables automatically.
  2. Template CSS — The structural styling (layout, spacing, transitions). Editable in the Advanced editor.
  3. Custom CSS — Your override layer. Anything you put here takes priority.

The admin controls set CSS variables like --marqo-sale-badge-bg: #dc2626. The template CSS references them with var(--marqo-sale-badge-bg). This means you can freely edit the template HTML and CSS without breaking the admin controls — as long as you keep the var() references.

Safe Editing Rules

DO

  • Change layout properties (padding, margin, position, flex, grid)
  • Change transitions and animations
  • Add new CSS classes and elements
  • Rearrange HTML elements within a template
  • Use var(--marqo-*) references for colors and sizes you want admin-controllable

DON'T

  • Replace var(--marqo-*) with hardcoded colors (the admin control will stop working)
  • Remove HTML elements with marqo- class names (the admin will warn you if you do)
  • Remove data-position or data-align attributes (used by the styling system)

If You Break Something

Each template has a Reset to Default button that restores the original HTML and CSS while keeping all your color and size settings from the admin controls.

Available CSS Variables

All variables are scoped to .marqo-search-layout. Use them in your Custom CSS or template edits.

Sale Badge

VariableDescriptionDefault
--marqo-sale-badge-bgBadge background color#dc2626
--marqo-sale-badge-textBadge text color#ffffff
--marqo-sale-badge-radiusBadge corner rounding4px

CTA Button

VariableDescriptionDefault
--marqo-cta-bgButton background color#000000
--marqo-cta-textButton text color#ffffff
--marqo-cta-border-colorButton border color#000000
--marqo-cta-border-widthButton border thickness0px
--marqo-cta-border-radiusButton corner rounding0px
--marqo-cta-widthButton width (100% or auto)100%

Price Display

VariableDescriptionDefault
--marqo-price-sale-colorSale price text color#dc2626
--marqo-price-compare-colorCompare-at (strikethrough) price color#9ca3af
--marqo-price-regular-colorRegular price text color#059669
--marqo-price-fontPrice font familyinherit
--marqo-price-sizePrice font size16px
--marqo-price-weightPrice font weight700

Product Card

VariableDescriptionDefault
--marqo-card-bgCard background color#ffffff
--marqo-card-border-colorCard border color#e2e8f0
--marqo-card-border-widthCard border thickness1px
--marqo-card-border-radiusCard corner rounding8px
--marqo-column-spacingGap between cards in the grid16px
--marqo-card-image-ratioImage aspect ratio (1/1, 3/4, 9/16)1/1

Vendor Name

VariableDescriptionDefault
--marqo-vendor-fontVendor text font familyinherit
--marqo-vendor-sizeVendor text font size12px
--marqo-vendor-weightVendor text font weight500
--marqo-vendor-colorVendor text color#64748b

Product Title

VariableDescriptionDefault
--marqo-title-fontTitle font familyinherit
--marqo-title-sizeTitle font size14px
--marqo-title-weightTitle font weight600
--marqo-title-colorTitle text color#1e293b

Reviews

VariableDescriptionDefault
--marqo-star-colorStar rating fill color#f59e0b
--marqo-star-sizeStar rating font size16px
--marqo-review-text-colorReview count text color#6b7280

Filter Sidebar

VariableDescriptionDefault
--marqo-filter-bgSidebar background color#ffffff
--marqo-filter-radiusSidebar corner rounding8px
--marqo-filter-text-colorFilter label text color#1e293b
--marqo-filter-text-sizeFilter label font size14px
--marqo-filter-text-fontFilter label font familyinherit
--marqo-filter-text-weightFilter label font weight500
--marqo-filter-separatorDivider line color (transparent to hide)#e2e8f0
--marqo-filter-active-indicatorActive filter indicator color (transparent to hide)#3b82f6
--marqo-filter-btn-bgFilters button background#ffffff
--marqo-filter-btn-textFilters button text color#1e293b
--marqo-filter-btn-borderFilters button border color#e2e8f0

Sort Dropdown

VariableDescriptionDefault
--marqo-sort-dropdown-bgSort dropdown background#ffffff
--marqo-sort-dropdown-borderSort dropdown border color#e2e8f0
--marqo-sort-dropdown-textSort dropdown text color#1e293b

Per-Page Dropdown

VariableDescriptionDefault
--marqo-page-dropdown-bgPer-page dropdown background#ffffff
--marqo-page-dropdown-borderPer-page dropdown border color#e2e8f0
--marqo-page-dropdown-textPer-page dropdown text color#1e293b

Results Count

VariableDescriptionDefault
--marqo-results-fontResults count font familyinherit
--marqo-results-sizeResults count font size14px
--marqo-results-weightResults count font weight400
--marqo-results-colorResults count text color#6b7280

Custom CSS Examples

Change card hover effect

.marqo-product-card:hover {
transform: scale(1.02);
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

Round product images

.marqo-product-card-image {
border-radius: 50%;
overflow: hidden;
}

Hide the vendor name

.marqo-vendor { display: none; }

Custom sale badge style

.marqo-sale-badge {
background: var(--marqo-sale-badge-bg) !important;
border-radius: 0 !important;
text-transform: lowercase !important;
font-style: italic;
}

Full-width cards on mobile

@media (max-width: 480px) {
.marqo-results-grid {
grid-template-columns: 1fr !important;
}
}

Change filter sidebar width

.marqo-filter-sidebar {
width: 280px !important;
max-width: 280px !important;
}

Use a variable in Custom CSS to override the admin

/* Override the sale badge color just for this page */
.marqo-search-layout {
--marqo-sale-badge-bg: hotpink;
--marqo-sale-badge-text: black;
}

Responsive Behavior

The widget automatically scales down on smaller screens:

Screen sizeWhat changes
Desktop (>1024px)Full layout — sidebar filters, multi-column grid
Tablet (481–1024px)Reduced columns, 90% font sizes, 75% spacing
Mobile (≤480px)Single/dual column, 80% font sizes, 50% spacing

The column counts at each breakpoint are set in the admin UI under Product Column Breakpoints. The filter sidebar switches to a mobile overlay at the Filter Mobile Breakpoint (configurable, default 768px).

Font and spacing scaling is proportional — if you increase the base vendor font size to 16px in the admin, it automatically becomes 14.4px on tablet and 12.8px on mobile.

Handlebars Variables

The product card HTML template uses Handlebars for dynamic content. Available variables:

Product Data

VariableDescription
{{productUrl}}Link to the product page
{{imageUrl}}Primary product image URL
{{title}}Product title
{{vendor}}Brand/vendor name
{{price}}Formatted price (e.g., "$40.00")
{{compareAtPrice}}Formatted compare-at price (empty if not on sale)
{{variantTitle}}Variant name
{{description}}Truncated product description
{{productCollections}}Collection names

Sale Badge

VariableDescription
{{salePercent}}Sale discount percentage (0 if not on sale)
{{saleBadgeLabel}}Formatted badge text (e.g., "SAVE 40%")
{{saleBadgePosition}}Badge position ("top-left" or "top-right")

Reviews

VariableDescription
{{reviewAverage}}Average review rating (0 if no reviews)
{{reviewCount}}Number of reviews
{{reviewPercentage}}Star fill percentage (0-100)
{{showReviewCount}}Whether to show the review count number

CTA Button

VariableDescription
{{ctaEnabled}}Whether the CTA button is shown
{{ctaButtonText}}Button text (e.g., "Shop Now")
VariableDescription
{{hasMultipleImages}}Whether product has multiple images
{{{imageUrlsJson}}}JSON array of all image URLs (triple braces = unescaped)
{{carouselAlwaysClass}}CSS class for always-visible arrows

Conditionals

{{#if salePercent}}
<!-- Only shown for products on sale -->
{{/if}}

{{#if compareAtPrice}}
<!-- Only shown when there's a compare-at price -->
{{/if}}

{{#if reviewAverage}}
<!-- Only shown for products with reviews -->
{{/if}}

{{#if ctaEnabled}}
<!-- Only shown when CTA button is enabled -->
{{/if}}

{{#if hasMultipleImages}}
<!-- Only shown for multi-image products -->
{{/if}}

Dynamic Product Fields

Any field from the Marqo index can be used directly:

{{productType}}
{{productTags}}
{{variantOption1}}
{{variantOption2}}

Troubleshooting

"Missing elements" warning in Advanced editor

You removed an HTML element that admin controls depend on. The warning tells you which controls are affected. Use the Reset button to restore the element.

Admin color picker has no effect

The template CSS might have a hardcoded color instead of a var() reference. Check the Advanced CSS editor for the selector and replace the hardcoded value with the appropriate var(--marqo-*).

Custom CSS not applying

Make sure your selector is specific enough. Use !important if needed, or increase specificity:

/* More specific */
.marqo-search-layout .marqo-product-card .marqo-vendor {
color: red;
}

Changes not showing after save

  1. Hard refresh the storefront (Cmd+Shift+R)
  2. Clear sessionStorage: run sessionStorage.clear() in the browser console
  3. Wait 1-2 minutes for Shopify's metafield cache to update