Theme CSS variables reference
Theme CSS variables are a set of standard style variables that themes provide to app blocks. They all start with --spz-theme-. When your block references them in its styles, its buttons, prices, fonts, corner radii, and other visuals follow the store's current theme and the merchant's settings. Without these variables, block styles have to be hard-coded, so when the merchant changes the theme's colors or button radius, your block doesn't follow; with them, the same block styles work on every supported theme. There are 163 variables.
Theme CSS variables only provide individual style values. They don't provide structural information such as layout, position, or visibility, and they don't provide a JavaScript interface. To read product data or listen for buyer actions, use ThemeApi. Pages that the theme doesn't render, such as the checkout page or custom landing pages, don't have these variables.
Quick start
Reference variables with var() in your block's CSS. The first argument is the variable name, and the second is the fallback value, the value your block hard-coded before it used the variables.
.my-app-block .cta {
background: var(--spz-theme-button-bg-color, #1d1f23);
color: var(--spz-theme-button-text-color, #ffffff);
border-radius: var(--spz-theme-button-radius, 4px);
}
.my-app-block .price {
color: var(--spz-theme-pdp-price-color, #1c1f23);
font-size: var(--spz-theme-pdp-price-font-size, 24px);
}
In these cases the page has no matching variable: the store's theme isn't supported, the page isn't rendered by the theme, or the theme doesn't provide that variable. The browser then uses the second argument, and your block looks the way it did before. Without a second argument, the declaration is dropped entirely.
On stores that use a supported theme, the page <head> automatically includes a <style id="spz-theme-vars"> block. Your block doesn't need to load any script or stylesheet; reference the variables directly in its CSS. When the merchant changes the theme settings, the variable values change with them.
To check whether a store outputs the variables, search for spz-theme-vars in the Elements panel of your browser's developer tools; if you find the <style> block, the variables are in place. You can also run the following in the Console; a non-empty value means the variables are available:
getComputedStyle(document.body).getPropertyValue('--spz-theme-button-bg-color')
Color variables take their values from the theme's color scheme and can be empty when read on the html element, so read them on body or on your block's own element.
Theme support
For themes not listed below, the page has none of these variables and your block uses its fallback values.
| Theme | Minimum version | Variables provided | Notes |
|---|---|---|---|
| Reformia | v26.54.44 | 162 / 163 | Color variables follow the color scheme of each section |
| Nova | v26.19.0 | 159 / 163 | A few variables have different values inside the cart drawer |
| Farida | v26.13.0 | 159 / 163 | A few variables have different values inside the cart drawer |
| Hero | v26.13.0 | 156 / 163 | |
| Geek | v26.18.0 | 162 / 163 | A few variables have different values inside the cart drawer |
| Eva | v26.12.27 | 159 / 163 |
Variables a theme doesn't provide are marked in the "Not provided by" column of the variable list. On those themes, your block uses the fallback values.
Reformia outputs CSS variables starting from v26.54.44, later than the v26.54.17 that ThemeApi requires. If your block uses both, v26.54.44 is the minimum.
Choose and reference variables
Naming
Each variable name has four parts: prefix, scenario, element, and property.
--spz-theme- pdp- atc-button- radius
prefix scenario element property
| Scenario part | Scenario | Covers | Variables |
|---|---|---|---|
| (none) | Global | Shared across pages: page width and margins, grid spacing, text colors, button shape and colors, inputs, overlay shadow, and the corner radius of toasts, progress bars, and pills | 30 |
pdp- | Product page | Product title, prices, discount badge, variant buttons, quantity selector, add-to-cart and buy-now buttons, stock notice | 65 |
plp- | Collection page | Collection title and product cards (product name, price, compare-at price, badges, swatches, image, container) | 28 |
cart- | Cart | Drawer container, cart title, line items, subtotal area, checkout button | 36 |
atc-modal- | Added-to-cart modal | Width, height, border, and corner radius of the modal that appears after an item is added to the cart | 4 |
atc-modal- refers to the modal that appears after a buyer adds an item to the cart, not the quick add modal.
Choosing a variable
Each variable takes its value from one of the theme's elements, and the variable name names that element. --spz-theme-button-bg-color is the background of the theme's primary button, and --spz-theme-pdp-save-badge-radius is the corner radius of the discount badge on the product page. You can use these values on any element of your block, on any page.
When choosing a variable, ask which theme element this part of your block should look like.
- A solid button in your block matches the theme's primary button: use
--spz-theme-button-*. - Outline buttons and dropdowns match the secondary button: use
--spz-theme-button-secondary-*. - A promotion label matches the discount badge: use
--spz-theme-pdp-save-badge-*.
The same kind of element can have different values on different pages. For example, the main price on the product page and the line item price in the cart have different font sizes, so variables are grouped by scenario. When the page your block is on has the matching element, prefer that scenario's variables. For shared visuals such as buttons, inputs, and overlay shadows, use the global variables without a scenario part.
Syntax
/* Follow directly */
background: var(--spz-theme-button-bg-color, #1d1f23);
/* Scale */
font-size: calc(var(--spz-theme-pdp-variant-title-font-size, 14px) * 0.8);
/* Clamp to a range */
border-radius: min(var(--spz-theme-button-radius, 4px), 8px);
font-size: clamp(12px, var(--spz-theme-pdp-variant-title-font-size, 14px), 18px);
- Variables ending in
-borderare fullbordershorthand values, for example1px solid #e5e5e5. Use them withborder. - Variables ending in
-paddingarepaddingshorthand values with two or four values. Use them withpadding; they can't go insidecalc(). --spz-theme-overlay-shadowis a fullbox-shadowvalue.- A few variables use a short attribute segment: names ending in
-bgare background colors, the same as-bg-color, and--spz-theme-cart-checkout-coloris the text color of the checkout button.
Scope
Most variables have a single value across the page, so your block gets the same result wherever it sits. In the three cases below, the value depends on where your block is. Place your block inside the matching container and it picks up the matching values automatically.
| Case | Themes | Variables affected | Description |
|---|---|---|---|
| Color scheme sections | Reformia | 49 color variables | When your block is inside a section that uses a non-default color scheme, color variables take that section's colors |
| Cart drawer | Nova, Farida, Geek | A few cart variables | When your block is inside the cart drawer, it gets the values inside the drawer |
| Mobile | All themes | Some font size and dimension variables | Values switch automatically below the theme's own breakpoint; you don't need media queries |
If your block's container isn't inside the cart drawer but needs the drawer values, add the data-spz-theme-scope="cart-drawer" attribute to the container:
<div class="my-app-block" data-spz-theme-scope="cart-drawer">
<!-- Cart variables here take the drawer values -->
</div>
To use a specific color scheme on Reformia, add the theme's color scheme class to the container, for example class="color-scheme-3". Overlays attached to body get the page's default color scheme.
Rules
Basic rules
Don't assign --spz-theme-* values on html, body, or theme sections. The theme's own elements also read these variables, so overriding them changes the theme's buttons and prices and overrides the values for color scheme sections and the cart drawer.
- Always provide a fallback: give every
var()a second argument. - Don't output empty values:
--x: ;is a valid empty value in CSS. It doesn't trigger the fallback and makes the whole declaration fail. When one of your app's own setting variables has no value, don't output that line. - Only reference
--spz-theme-*: the theme's other CSS variables may be renamed or removed when the theme is upgraded. The--spz-theme-*names are defined by this page. - Match the names in the list: a misspelled variable name doesn't cause an error in the browser; it silently uses the fallback.
- Use your own prefix for derived values: declare scaled, clamped, or semi-transparent values in your block's own container with your app's prefix, for example
--plg-*. Don't declare new--spz-theme-*variables.
Combining with your app's settings
When your app has its own settings, the order of precedence is app setting, then theme, then fallback. One nested var() expresses this:
.my-app-block {
/* Use the app setting if the merchant set one; otherwise follow the theme; otherwise use the fallback */
--plg-btn-bg: var(--cfg-btn-bg, var(--spz-theme-button-bg-color, #1d1f23));
}
.my-app-block .cta { background: var(--plg-btn-bg); }
Exceptions for specific themes
The variables reflect each theme's design as it is, and a value on a particular theme may not suit how your block uses it. For example, Geek's buy-now button is an outline button with a transparent background. transparent is a valid value, so it doesn't trigger the fallback. In this case, override your app's own variable for that theme on your block's root node, and keep referencing --spz-theme-* for the exception value:
.my-app-block {
--plg-selected: var(--spz-theme-pdp-buy-button-bg-color, #1d1f23);
}
#geek-theme .my-app-block {
--plg-selected: var(--spz-theme-pdp-buy-button-border-color, #1d1f23);
}
Each theme has a fixed identifier on body. It doesn't change when the merchant renames or duplicates the theme.
| Theme | Selector |
|---|---|
| Reformia | #next-theme |
| Nova | #nova-theme |
| Farida | Same as Nova; can't be told apart by identifier |
| Hero | #hero-2024 |
| Geek | #geek-theme |
| Eva | body.eva |
Variable list
"Source" tells you which theme element and property the variable takes its value from. An empty "Not provided by" column means all six themes provide the variable.
Global (30)
| Variable | Source | Not provided by | Notes |
|---|---|---|---|
--spz-theme-page-width | Page width · Maximum width | ||
--spz-theme-page-gutter | Page side margins · Side margins | ||
--spz-theme-grid-gap-x | Grid spacing · Horizontal spacing | ||
--spz-theme-grid-gap-y | Grid spacing · Vertical spacing | ||
--spz-theme-button-radius | Button shape · Border radius | ||
--spz-theme-button-border-width | Button shape · Border width | ||
--spz-theme-button-padding | Button shape · Primary button padding | Nova, Farida, Hero | |
--spz-theme-button-secondary-padding | Button shape · Secondary button padding | Nova, Farida, Hero | |
--spz-theme-text-color | Text colors · Body text color | Follows the color scheme on Reformia | |
--spz-theme-heading-color | Text colors · Heading color | Follows the color scheme on Reformia | |
--spz-theme-button-bg-color | Button colors / primary button · Primary button background | Follows the color scheme on Reformia | |
--spz-theme-button-text-color | Button colors / primary button · Primary button text color | Follows the color scheme on Reformia | |
--spz-theme-button-border-color | Button colors / primary button · Primary button border color | Follows the color scheme on Reformia | |
--spz-theme-button-secondary-bg-color | Button colors / secondary button · Secondary button background | Follows the color scheme on Reformia | |
--spz-theme-button-secondary-text-color | Button colors / secondary button · Secondary button text color | Follows the color scheme on Reformia | |
--spz-theme-button-secondary-border-color | Button colors / secondary button · Secondary button border color | Follows the color scheme on Reformia | |
--spz-theme-button-hover-bg-color | Button hover · Hover background | Follows the color scheme on Reformia | |
--spz-theme-button-hover-text-color | Button hover · Hover text color | Follows the color scheme on Reformia | |
--spz-theme-button-hover-border-color | Button hover · Hover border color | Follows the color scheme on Reformia | |
--spz-theme-button-secondary-hover-bg-color | Secondary button hover · Hover background | Follows the color scheme on Reformia | |
--spz-theme-button-secondary-hover-text-color | Secondary button hover · Hover text color | Follows the color scheme on Reformia | |
--spz-theme-button-secondary-hover-border-color | Secondary button hover · Hover border color | Follows the color scheme on Reformia | |
--spz-theme-input-bg-color | Input · Background | Follows the color scheme on Reformia | |
--spz-theme-input-text-color | Input · Text color | Follows the color scheme on Reformia | |
--spz-theme-input-border-color | Input · Border color | Follows the color scheme on Reformia | |
--spz-theme-input-radius | Input · Border radius | ||
--spz-theme-overlay-shadow | Overlay shadow · Shadow | Nova, Farida, Eva | Follows the color scheme on Reformia |
--spz-theme-toast-radius | Toast / progress bar / pill radius · Toast | ||
--spz-theme-progress-radius | Toast / progress bar / pill radius · Progress bar | ||
--spz-theme-pill-radius | Toast / progress bar / pill radius · Pill label |
Product page (65)
| Variable | Source | Not provided by | Notes |
|---|---|---|---|
--spz-theme-pdp-title-font-family | Product title · Font family | ||
--spz-theme-pdp-title-font-size | Product title · Font size | ||
--spz-theme-pdp-title-line-height | Product title · Line height | ||
--spz-theme-pdp-title-font-weight | Product title · Font weight | ||
--spz-theme-pdp-title-color | Product title · Text color | Follows the color scheme on Reformia | |
--spz-theme-pdp-subtitle-font-size | Subtitle / short description · Font size | Hero | |
--spz-theme-pdp-subtitle-line-height | Subtitle / short description · Line height | ||
--spz-theme-pdp-subtitle-font-weight | Subtitle / short description · Font weight | ||
--spz-theme-pdp-subtitle-color | Subtitle / short description · Text color | Follows the color scheme on Reformia | |
--spz-theme-pdp-price-font-family | Main price · Font family | ||
--spz-theme-pdp-price-font-size | Main price · Font size | ||
--spz-theme-pdp-price-line-height | Main price · Line height | ||
--spz-theme-pdp-price-font-weight | Main price · Font weight | ||
--spz-theme-pdp-price-color | Main price · Text color | Follows the color scheme on Reformia | |
--spz-theme-pdp-compare-price-font-size | Compare-at price · Font size | ||
--spz-theme-pdp-compare-price-line-height | Compare-at price · Line height | ||
--spz-theme-pdp-compare-price-font-weight | Compare-at price · Font weight | ||
--spz-theme-pdp-compare-price-color | Compare-at price · Text color | Follows the color scheme on Reformia | |
--spz-theme-pdp-save-badge-font-size | Discount badge / savings label · Font size | ||
--spz-theme-pdp-save-badge-line-height | Discount badge / savings label · Line height | ||
--spz-theme-pdp-save-badge-font-weight | Discount badge / savings label · Font weight | ||
--spz-theme-pdp-save-badge-color | Discount badge / savings label · Text color | Follows the color scheme on Reformia | |
--spz-theme-pdp-save-badge-border | Discount badge / savings label · Border | ||
--spz-theme-pdp-save-badge-radius | Discount badge / savings label · Border radius | Eva | |
--spz-theme-pdp-save-badge-padding | Discount badge / savings label · Padding | ||
--spz-theme-pdp-variant-title-font-family | Variant group title · Font family | ||
--spz-theme-pdp-variant-title-font-size | Variant group title · Font size | ||
--spz-theme-pdp-variant-title-font-weight | Variant group title · Font weight | ||
--spz-theme-pdp-variant-font-size | Variant button · Font size | Hero | |
--spz-theme-pdp-variant-line-height | Variant button · Line height | ||
--spz-theme-pdp-variant-font-weight | Variant button · Font weight | ||
--spz-theme-pdp-variant-color | Variant button · Text color | Follows the color scheme on Reformia | |
--spz-theme-pdp-variant-border | Variant button · Border | Follows the color scheme on Reformia | |
--spz-theme-pdp-variant-radius | Variant button · Border radius | ||
--spz-theme-pdp-variant-min-width | Variant button · Minimum width | ||
--spz-theme-pdp-variant-min-height | Variant button · Minimum height | ||
--spz-theme-pdp-variant-max-width | Variant button · Maximum width | ||
--spz-theme-pdp-variant-padding | Variant button · Padding | ||
--spz-theme-pdp-variant-gap | Variant button · Button spacing | ||
--spz-theme-pdp-qty-label-font-family | Quantity label · Font family | ||
--spz-theme-pdp-qty-label-font-size | Quantity label · Font size | ||
--spz-theme-pdp-qty-label-line-height | Quantity label · Line height | ||
--spz-theme-pdp-qty-label-font-weight | Quantity label · Font weight | ||
--spz-theme-pdp-qty-label-color | Quantity label · Text color | Follows the color scheme on Reformia | |
--spz-theme-pdp-qty-font-size | Quantity selector · Font size | Reformia, Hero | |
--spz-theme-pdp-qty-radius | Quantity selector · Border radius | ||
--spz-theme-pdp-atc-button-font-size | Add-to-cart button · Font size | ||
--spz-theme-pdp-atc-button-line-height | Add-to-cart button · Line height | ||
--spz-theme-pdp-atc-button-font-weight | Add-to-cart button · Font weight | ||
--spz-theme-pdp-atc-button-height | Add-to-cart button · Height | ||
--spz-theme-pdp-atc-button-padding | Add-to-cart button · Padding | ||
--spz-theme-pdp-atc-button-radius | Add-to-cart button · Border radius | ||
--spz-theme-pdp-atc-button-bg-color | Add-to-cart button · Background | Follows the color scheme on Reformia | |
--spz-theme-pdp-atc-button-text-color | Add-to-cart button · Text color | Follows the color scheme on Reformia | |
--spz-theme-pdp-atc-button-border-color | Add-to-cart button · Border color | Follows the color scheme on Reformia | |
--spz-theme-pdp-buy-button-font-size | Buy-now button · Font size | ||
--spz-theme-pdp-buy-button-line-height | Buy-now button · Line height | ||
--spz-theme-pdp-buy-button-font-weight | Buy-now button · Font weight | ||
--spz-theme-pdp-buy-button-bg-color | Buy-now button · Background | Follows the color scheme on Reformia | |
--spz-theme-pdp-buy-button-text-color | Buy-now button · Text color | Follows the color scheme on Reformia | |
--spz-theme-pdp-buy-button-border-color | Buy-now button · Border color | Follows the color scheme on Reformia | |
--spz-theme-pdp-stock-note-font-size | Stock notice · Font size | ||
--spz-theme-pdp-stock-note-line-height | Stock notice · Line height | ||
--spz-theme-pdp-stock-note-font-weight | Stock notice · Font weight | ||
--spz-theme-pdp-stock-note-color | Stock notice · Text color |
Collection page (28)
| Variable | Source | Not provided by | Notes |
|---|---|---|---|
--spz-theme-plp-title-font-size | Collection title · Font size | ||
--spz-theme-plp-title-line-height | Collection title · Line height | ||
--spz-theme-plp-title-font-weight | Collection title · Font weight | ||
--spz-theme-plp-title-font-family | Collection title · Font family | ||
--spz-theme-plp-title-color | Collection title · Color | Follows the color scheme on Reformia | |
--spz-theme-plp-card-title-font-size | Product card / product name · Font size | ||
--spz-theme-plp-card-title-line-height | Product card / product name · Line height | ||
--spz-theme-plp-card-title-font-weight | Product card / product name · Font weight | ||
--spz-theme-plp-card-title-font-family | Product card / product name · Font family | ||
--spz-theme-plp-card-title-color | Product card / product name · Text color | Follows the color scheme on Reformia | |
--spz-theme-plp-card-price-font-size | Product card / price · Font size | ||
--spz-theme-plp-card-price-font-weight | Product card / price · Font weight | ||
--spz-theme-plp-card-price-color | Product card / price · Color | Follows the color scheme on Reformia | |
--spz-theme-plp-card-compare-font-size | Product card / compare-at price · Font size | ||
--spz-theme-plp-card-compare-line-height | Product card / compare-at price · Line height | ||
--spz-theme-plp-card-compare-font-weight | Product card / compare-at price · Font weight | ||
--spz-theme-plp-card-compare-color | Product card / compare-at price · Color | Follows the color scheme on Reformia | |
--spz-theme-plp-badge-font-size | Product card / discount badge · Font size | ||
--spz-theme-plp-badge-padding | Product card / discount badge · Padding | ||
--spz-theme-plp-badge-radius | Product card / discount badge · Border radius | ||
--spz-theme-plp-badge-color | Product card / discount badge · Color | Follows the color scheme on Reformia | |
--spz-theme-plp-soldout-color | Product card / sold-out label · Color | Follows the color scheme on Reformia | |
--spz-theme-plp-quick-add-color | Product card / quick add · Color | Follows the color scheme on Reformia | |
--spz-theme-plp-swatch-gap | Product card / variant swatches / thumbnails · Spacing | ||
--spz-theme-plp-swatch-radius | Product card / variant swatches / thumbnails · Border radius | ||
--spz-theme-plp-card-image-radius | Product card / image · Border radius | ||
--spz-theme-plp-card-image-aspect-ratio | Product card / image · Aspect ratio | ||
--spz-theme-plp-card-radius | Product card container · Container border radius |
Cart (36)
| Variable | Source | Not provided by | Notes |
|---|---|---|---|
--spz-theme-cart-drawer-width | Drawer container · Width | ||
--spz-theme-cart-drawer-radius | Drawer container · Border radius | ||
--spz-theme-cart-title-font-size | Cart title · Font size | Hero | |
--spz-theme-cart-title-line-height | Cart title · Line height | ||
--spz-theme-cart-title-font-weight | Cart title · Font weight | ||
--spz-theme-cart-title-font-family | Cart title · Font family | ||
--spz-theme-cart-title-color | Cart title · Text color | Follows the color scheme on Reformia | |
--spz-theme-cart-item-title-font-size | Line item / product name · Font size | ||
--spz-theme-cart-item-title-line-height | Line item / product name · Line height | ||
--spz-theme-cart-item-title-font-weight | Line item / product name · Font weight | ||
--spz-theme-cart-item-title-font-family | Line item / product name · Font family | ||
--spz-theme-cart-item-title-color | Line item / product name · Text color | Follows the color scheme on Reformia | |
--spz-theme-cart-item-variant-font-size | Line item / variant text · Font size | ||
--spz-theme-cart-item-variant-color | Line item / variant text · Color | Follows the color scheme on Reformia | |
--spz-theme-cart-item-variant-bg | Line item / variant text · Background | Nova, Farida, Hero, Geek, Eva | Follows the color scheme on Reformia |
--spz-theme-cart-item-price-font-size | Line item / price · Font size | Different value inside the cart drawer on Nova, Farida, Geek | |
--spz-theme-cart-item-price-line-height | Line item / price · Line height | Different value inside the cart drawer on Geek | |
--spz-theme-cart-item-price-font-weight | Line item / price · Font weight | ||
--spz-theme-cart-item-price-color | Line item / price · Text color | Follows the color scheme on Reformia | |
--spz-theme-cart-item-compare-font-family | Line item / price · Compare-at price · Font family | ||
--spz-theme-cart-item-compare-font-size | Line item / price · Compare-at price · Font size | Different value inside the cart drawer on Nova, Farida | |
--spz-theme-cart-item-compare-line-height | Line item / price · Compare-at price · Line height | ||
--spz-theme-cart-item-compare-font-weight | Line item / price · Compare-at price · Font weight | ||
--spz-theme-cart-item-compare-color | Line item / price · Compare-at price · Color | Follows the color scheme on Reformia | |
--spz-theme-cart-qty-height | Line item / quantity selector · Height | ||
--spz-theme-cart-qty-width | Line item / quantity selector · Width | ||
--spz-theme-cart-qty-radius | Line item / quantity selector · Border radius | Different value inside the cart drawer on Farida | |
--spz-theme-cart-qty-border | Line item / quantity selector · Border | Follows the color scheme on Reformia | |
--spz-theme-cart-item-image-radius | Line item / product image · Border radius | ||
--spz-theme-cart-summary-card-bg | Subtotal / total area · Container background | Eva | Follows the color scheme on Reformia |
--spz-theme-cart-checkout-bg | Checkout button · Background | Follows the color scheme on Reformia | |
--spz-theme-cart-checkout-color | Checkout button · Text color | Follows the color scheme on Reformia | |
--spz-theme-cart-checkout-height | Checkout button · Height | ||
--spz-theme-cart-checkout-font-size | Checkout button · Font size | ||
--spz-theme-cart-checkout-font-weight | Checkout button · Font weight | ||
--spz-theme-cart-checkout-radius | Checkout button · Border radius |
Added-to-cart modal (4)
| Variable | Source | Not provided by | Notes |
|---|---|---|---|
--spz-theme-atc-modal-width | Modal container · Width | ||
--spz-theme-atc-modal-max-height | Modal container · Maximum height | ||
--spz-theme-atc-modal-border-width | Modal container · Border width | ||
--spz-theme-atc-modal-radius | Modal container · Border radius |
FAQ
I can't see the variables on the page
Make sure the store's theme is listed under Theme support and that the page is rendered by the theme. Select the body element in the developer tools; the Styles panel should show the --spz-theme-* variables.
My block's styles don't follow the theme
Check that the variable names match the list; a misspelled name doesn't cause an error. Then check whether the theme provides that variable.
The value is transparent or none, and the fallback isn't used
var() uses the fallback only when the variable doesn't exist. transparent, none, and auto set by the theme are valid values. If needed, handle it as described in Exceptions for specific themes.
My block in the cart drawer gets the wrong values
Make sure your block's node is inside the drawer container. If your block is attached to body, add data-spz-theme-scope="cart-drawer" to its container.