Skip to main content

Change the Unit Toggle Placement with Custom CSS

This guide shows you how to change the placement of the unit toggle in the SmartSize size chart popup using custom CSS.

Guide type: Task guide
​Difficulty: Intermediate
​Applies to: SmartSize size chart popup
​

This guide shows you how to change the placement of the unit toggle in the SmartSize size chart popup using custom CSS. By default, the unit toggle may appear in a position that doesn't suit your store's layout. With a custom CSS rule, you can move it directly below the size chart table for a cleaner, more intuitive experience.
​

Before you start

You need:

  • Access to the SmartSize admin.

  • A size chart configured with the unit toggle enabled.

  • The ability to add custom CSS to your SmartSize settings.

Steps

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

  2. In the left navigation, under General settings, select Custom CSS.

  3. Paste the CSS below into the Custom CSS field.

  4. Click Save.

  5. Open a storefront product page, open the size chart popup, and verify that the unit toggle appears directly below the table.

Worked example

The following CSS moves the unit toggle below the size chart table while keeping other content, such as tips, text, and images, after the toggle.
​

/* Turn the body wrapper into a flex column so its children can be reordered */ 
.smartrecom-sizechart-body > div {
display: flex;
flex-direction: column;
}

/* Default: everything else (tips, text, images) goes last */
.smartrecom-sizechart-body > div > div {
order: 2;
}

/* Table block(s) first */
.smartrecom-sizechart-body > div > div:has(.smartrecom-table) {
order: 0; }

/* Unit toggle right after the table */
.smartrecom-sizechart-body > div > div:has(> .smartrecom-unit-toggle) {
order: 1;
margin: 8px 0 4px !important;

/* the row has an inline margin-bottom, hence !important */ }

How it works

  • Flex column layout: Allows the popup's content sections to be reordered vertically.

  • Table first: Places the size chart table at the top of the content order.

  • Unit toggle second: Moves the unit toggle immediately after the table.

  • Other content last: Keeps additional content, including tips, text, and images, below the unit toggle.

  • Spacing adjustment: Adds spacing around the unit toggle row. The !important declaration overrides the row's existing inline bottom margin.

Troubleshooting

If the unit toggle does not move as expected:

  1. Confirm that the CSS was saved in Settings → Global settings → Custom CSS.

  2. Reload the storefront page and reopen the size chart popup.

  3. Inspect the popup to confirm that the relevant elements use the expected smartrecom-table and smartrecom-unit-toggle classes.

  4. Check whether the popup's HTML structure differs from the selectors used in the example.

Related articles

Did this answer your question?