Skip to main content

Styling Your Product Points Calculator

Where to add custom CSS for the PDP Points Calculator, plus its snippets and every class you can target.

Written by Kris James

The PDP Points Calculator shows customers on your product pages how many points they will earn by buying that product. In the Shopify theme editor the block is called Product Points Calculator. In store credit mode it is called the PDP Store Credit Calculator.

Most of its look is set in the app: display style, colours, text weight, icon, message text and click behaviour. Use custom CSS for anything those settings do not cover.


Where to Add Custom CSS

  1. Go to Loyalty Pages and find PDP Points Calculator under Storefront. Click Customise.

  2. Scroll to the Custom CSS section near the bottom of the settings.

  3. Enter your CSS. Type .mage to see the calculator's classes, or start typing a snippet name from the table below.

  4. Save your changes. The preview on the right shows the result.

The theme editor block has no CSS field of its own. Add calculator CSS in the app so it loads wherever the block is used.


Overriding Colours

The colours and corner radius you choose in the app are applied as inline styles. Layout rules such as padding, font size and borders work with a normal class selector, but to change a colour or radius that the app sets you need !important. The Text weight and Subtext weight settings are not inline, so a normal font-weight rule overrides them.

/* Works without !important */
.mage-product-points-calculator__message {
font-size: 15px;
}

/* Needs !important to beat the badge colour setting */
.mage-product-points-calculator__badge {
background-color: #1d1d1b !important;
}

CSS Snippets

The editor includes ready-made snippets. Start typing a snippet name and pick it from the list, then change the placeholder values.

Snippet

What it inserts

border

A border around the badge

value-color

Colour and weight for the points value only

icon

A small icon before the message text

background

A badge background colour override (uses !important)

text-size

A new size for the message text


CSS Class Reference

The block renders inside #mage-product-points-page-calculator. Its root element carries .mage-block plus the classes below.

Root

Class

What it styles

.mage-product-points-calculator

Root element for both display styles. The outer theme section wrapper also has this class. To target only the calculator, use .mage-product-points-calculator.mage-block or a display style modifier such as .mage-product-points-calculator--inline or .mage-product-points-calculator--badge.

.mage-product-points-calculator--inline

Root when Display Style is Inline text

.mage-product-points-calculator--badge

Root when Display Style is Badge pill

.mage-product-points-calculator--clickable

Root when the block is a link (Make clickable is on)

Message and badge

Class

What it styles

.mage-product-points-calculator__message

The earn message text, in both display styles

.mage-product-points-calculator__message--badge

The earn message inside the badge

.mage-product-points-calculator__badge

The badge pill (Badge pill style only)

.mage-product-points-calculator__value

The points value inside the message, from the {points} or {store_credit} placeholder

.mage-product-points-calculator__bonus-active

The extra line from Bonus active text, shown while a bonus campaign applies. Its colour comes from the Bonus active color setting, so a colour override needs !important


Examples

/* Make just the points number stand out */
.mage-product-points-calculator__value {
color: #b45309;
font-weight: 700;
}

/* Add space above the block on the badge style only */
.mage-product-points-calculator--badge {
margin-top: 12px;
}

Common Mistakes to Avoid

Colour rules that do nothing. The app's colour settings are inline styles, so add !important to colour and radius rules.

Using classes that no longer exist. The bonus multiplier note has been removed, so .mage-product-points-calculator__multiplier and its --inline, --pill and --badge variants no longer match anything. To show an extra line during a bonus campaign, use the Bonus active text setting. There is also no longer a Disable Customizer Styles option for this block.

Adding CSS in the theme editor. The block has no CSS field there. Use the Custom CSS section in the app.


Troubleshooting

My CSS is not showing on the product page

  • Check that you saved your changes in the app.

  • Check that the Product Points Calculator block is added to your product template in the theme editor.

  • Add !important if you are changing a colour, background or corner radius.

For the placeholders you can use in the messages, see Dynamic Text Inserts.

Did this answer your question?