Add custom CSS to style A2Reviews widgets

Most of the widget design can be changed with the built-in settings: colors, fonts, borders, layouts and more. When you need something those settings can't do, such as fixing spacing that clashes with your theme, you can add your own CSS in the Custom CSS editor.

Open the Custom CSS editor

  1. Go to Settings > Reviews (or Settings > Questions).
  2. Click the Custom CSS icon in the page heading, next to the Settings title. The Custom CSS panel opens.
  3. On Shopify, use Select theme to choose which theme the CSS applies to. Your published theme is marked Live, and Online Store 2.0 themes are labeled.

Custom CSS is saved separately for each Shopify theme. If you are preparing a new theme before publishing it, select that theme and add its CSS too.

Add and save your CSS

  1. Type or paste your CSS into the editor.
  2. Optionally open the code snippets list to insert a ready-made fix. Examples include "Fix stars rating heigh on Warehouse" for the Warehouse theme and "Fix SVG global" for star icons that display at the wrong size.
  3. Click CSS Beautify to tidy the formatting.
  4. If the Errors console shows problems, open Errors Details and fix them.
  5. Click Save Change. You will see "The CSS code has been updated successfully."

If you close the panel without saving, you'll be warned that your changes will be lost.

Example

This example adds space around the star rating under product titles and makes the review count text slightly smaller:

/* Space around the star rating under product titles */
a2-reviews-total {
  display: block;
  margin-top: 8px;
  margin-bottom: 8px;
}

/* Smaller star icons in the rating badge */
.a2-avg-rating .a2-avg-active > span svg,
.a2-avg-rating .a2-avg-bg > span svg {
  width: 16px;
  height: auto;
}

Tip: To find the right selector, right-click the element on your storefront and choose Inspect in your browser. A2Reviews elements usually have names starting with a2.

Good practices

Troubleshooting

Related articles: Review Widget, Review Blocks, Social Proof Popups.