Skip to main content

Style the SmartSize popups with custom CSS

Match the fit quiz and size chart popups to your brand — where to paste custom CSS, the class names to target, and how to make a rule win.

The SmartSize popups render inside a Shadow DOM, which isolates them so your theme never accidentally breaks them. The trade-off: CSS in your theme stylesheet can't reach inside the popups. To restyle them, paste your CSS into the Custom CSS field in SmartSize.


Where custom CSS applies

The Custom CSS field currently styles the size chart popup. SmartSize injects your stylesheet directly into that popup's Shadow DOM, where your rules take effect. All SmartSize classes start with smartrecom-.

To restyle the fit quiz button and popup, use the built-in appearance settings instead — accent color, corners, and recommendation format are all controlled from the theme editor and the quiz settings. See How to style your fit quiz button and the fit quiz customization articles.


Add your CSS

  1. In the SmartSize admin, open Settings → Global settings.

  2. Under General settings, select Custom CSS.

  3. Paste your rules into the field, targeting smartrecom- classes.

  4. Click Save.

  5. Open a storefront product page, reload it, and open the size chart popup to confirm your styles applied.


Making a rule win

This is the single most common reason a rule seems to "do nothing." Some popup styles are applied as inline styles on the element (and a few use !important) so the popup survives hostile theme CSS. In the browser's cascade, an inline style beats a plain class selector — so a rule like this is silently overridden:

/* ❌ Loses to the element's inline style */
.smartrecom-sizechart { font-family: "Georgia", serif; }

You have two ways to win:

1. Add !important. An !important declaration beats a normal inline style, and works for any property:

/* ✅ Wins */
.smartrecom-sizechart { font-family: "Georgia", serif !important; }

2. Set a CSS variable, where one exists. SmartSize reads some values from CSS variables, and a variable doesn't compete with inline styles — no !important needed:

/* ✅ Wins, no !important needed */
.smartrecom-sizechart { --smartrecom-font-family: "Georgia", serif; }


Size chart classes

Class

Element

.smartrecom-sizechart

Root wrapper — set font and CSS variables here.

.smartrecom-sizechart-header

Sticky header area (heading blocks, unit toggle, tabs).

.smartrecom-sizechart-body

Scrollable body holding the active tab's blocks.

.smartrecom-tab / .smartrecom-tab-active

A tab button, and the currently selected tab.

.smartrecom-unit-toggle / .smartrecom-unit-toggle-button

The metric/imperial toggle and its options.

.smartrecom-heading, .smartrecom-text, .smartrecom-callout

Content blocks: heading, paragraph, and callout.

.smartrecom-table

The size chart table.

.smartrecom-table-header / .smartrecom-table-cell

Header cells (th) and body cells (td).

.smartrecom-modal-content

The popup card (background, corners, shadow).

.smartrecom-modal-overlay

The background overlay behind the popup.

.smartrecom-close-button

The close (✕) button.

Table body cells have a transparent background by default, so a color set on the body or the popup card shows through the table — you don't need to restyle every cell to recolor the popup. Two exceptions paint their own background: striped rows (color set in the size chart editor) and the sticky first column, which stays opaque because the other columns scroll underneath it.


Size chart CSS variables

Set these on .smartrecom-sizechart (or any ancestor). Because they're variables, no !important is needed:

Variable

Controls

--smartrecom-font-family

Font family for the size chart content.

--smartrecom-chart-padding-x / -y

Horizontal and top gutters of the header and body.

--smartrecom-table-sticky-bg

Opaque background of the sticky first column.

--smartrecom-table-text-color

Table cell text color.

--smartrecom-table-empty-color

Placeholder (—) color in empty cells.


Worked example: recolor the size chart popup

Because table cells are transparent, coloring the header and body recolors the whole popup. Only the sticky column and the text need the variables:

/* Surfaces carry inline styles, so use !important */
.smartrecom-sizechart-header,
.smartrecom-sizechart-body,
.smartrecom-modal-content {
background: #1a1a2e !important;
}

/* Sticky column and text — variables, no !important */
.smartrecom-sizechart {
--smartrecom-table-sticky-bg: #1a1a2e;
--smartrecom-table-text-color: #f0f0f0;
--smartrecom-table-empty-color: #6a6a7a;
}

/* Header row color comes from the editor (inline) */
.smartrecom-table-header {
background: #16213e !important;
color: #f0f0f0 !important;
}


What to keep cosmetic

Safe to change: colors, fonts, spacing, sizing, borders, and shadows. Avoid overriding layout (flex/grid internals), positioning and z-index, transforms, and animations — those keep the popup working correctly across themes and devices.


Troubleshooting

My rule isn't applying. Confirm you pasted it in Settings → Global settings → Custom CSS (theme CSS can't reach the Shadow DOM), that the class exists (open the popup and inspect the element), and add !important if a built-in inline style is winning. Reload the storefront page after saving.


💡 Tip: Find the exact class to target by opening the size chart popup, right-clicking the element, and choosing Inspect — every SmartSize class starts with smartrecom-.

Did this answer your question?