Every Mage Loyalty landing page block comes with default styling that suits most themes, and every part of it can be restyled with your own CSS. This article covers where to add custom CSS, the shared CSS variables, and the class names for each block and dialog.
All classes use BEM naming with a mage- prefix, for example .mage-ways-to-earn__card. Each block renders inside a root element that carries mage-block plus its own block class, so your rules never need to touch your theme's own classes.
<div class="mage-block mage-ways-to-earn">
Where to Add Custom CSS
In the Mage Loyalty app
Go to Loyalty Pages and find Landing Page under Storefront. Click Customise.
Pick a section from the Sections list on the left, for example Ways to Earn.
Click View on the Advanced Settings card and enter your CSS in the Custom CSS editor. Type
.mageto see the classes for that block.Click Save. Your CSS is published to your storefront automatically.
Each section has its own Custom CSS field, limited to 64 KB. A size meter under the editor shows how much you have used.
In the Shopify theme editor
Every Mage block has an Advanced group in its theme editor settings with a Custom CSS field. This CSS applies to that block on that page only.
The Mage Block CSS app block adds CSS to the whole page. Use it for shared elements such as dialogs, or on pages where you have placed Mage elements with custom Liquid.
All of these fields add a normal <style> tag to the page, so a rule in any of them can reach any Mage element on the same page. If the theme editor field and the app field set the same property with the same selector, the app field wins because it loads last.
Overriding Colours
Colours you pick in the theme editor are applied as inline styles, which beat class selectors. You have two options.
Option 1: Disable Customizer Styles (recommended)
Each landing page block has a Disable Customizer Styles checkbox in the Advanced group of its theme editor settings. When it is ticked, the block drops its inline colour styles, so your CSS applies without !important.
Option 2: Use !important
Layout rules such as padding, border radius and grid settings work with a normal class selector. Colour rules need !important to beat the inline styles.
/* Layout override, no !important needed */
.mage-ways-to-earn__card {
border-radius: 1rem;
}
/* Colour override, !important required */
.mage-ways-to-earn__card-title {
color: #333 !important;
}
Shared CSS Variables
These variables control spacing, heading sizes and button corners across all landing page blocks at once. Set them on :root to change every block, or on one block's root class to change just that block. No !important is needed. Mobile variables apply at 767px wide and below.
Variable | What it controls |
| Top and bottom padding of every section. Default 48px. |
| Top or bottom padding only. Beats the shared padding variable. |
| Section padding on mobile. Falls back to the desktop value. |
| Top or bottom padding on mobile. |
| Gap between a section's heading and its content. Default 48px. |
| Section title font size. Default 30px, and 24px on mobile. |
| Section subtitle font size. Default 16px. |
| Font family for section titles. Not set by default, so titles follow your theme. |
| Corner radius of the main buttons in the blocks and dialogs. Default 0. |
/* Tighter sections everywhere */
:root {
--mage-block-section-padding: 32px;
--mage-block-button-radius: 8px;
--mage-block-title-font: var(--font-heading-family, Georgia);
}
/* Remove the top padding on the FAQ only */
.mage-faq-block {
--mage-block-section-padding-top: 0px;
}
A block's Custom vertical padding checkbox in the theme editor applies its own padding as an inline style, which overrides these padding variables.
Block Reference
Each block mounts into a container whose ID matches its root class, for example #mage-hero-banner (VIP Tier Benefits uses #mage-vip-tier-benefits). Use the ID to scope a rule to one block when you have two of the same block on a page.
In the tables, names that start with __ or -- are added to the block's root class. For example, under Hero Banner, __title means .mage-hero-banner__title and --logged-in means .mage-hero-banner--logged-in.
Hero Banner
Root: .mage-hero-banner.
Part | Classes |
Root |
|
Banner |
|
Columns |
|
Content |
|
Buttons |
|
Navigation |
|
The title, subtitle and buttons also carry a size modifier that matches the banner size, for example .mage-hero-banner__title--large or .mage-hero-banner__button--small.
How It Works
Root: .mage-how-it-works.
Part | Classes |
Layout |
|
Steps |
|
Step image |
|
Default icon |
|
Activity Overview
Root: .mage-activity-overview. This block was previously called Points Overview.
Part | Classes |
Header |
|
Table |
|
Rows |
|
Points and badges |
|
Loading, empty and pages |
|
Flexible Redemption
Root: .mage-flexible-redemption. The outer wrapper .mage-flexible-redemption-block carries the section background colour.
Part | Classes |
Layout |
|
Slider |
|
Buttons |
|
States |
|
Success |
|
Your Rewards
Root: .mage-rewards.
Part | Classes |
Layout |
|
Card |
|
Loading, empty and pages |
|
Reward dialog |
|
Code and details |
|
Ways to Earn
Root: .mage-ways-to-earn.
Part | Classes |
Layout |
|
Card |
|
Card content |
|
Badge and guest overlay |
|
Punch card |
|
Ways to Earn also has its own layout variables. Set them on .mage-ways-to-earn__grid or .mage-ways-to-earn__card.
Variable | What it controls |
| Columns on small screens (default 1), from 640px wide (default 2) and from 1024px wide (default 3). |
| Gap between cards. Default 8px. |
| Card shape. Default 1 (square), for example 4 / 3 for landscape. |
| Dark tint over cards with a background image. |
| Punch size and gap on the card. Default 22px and 6px. |
| Punch size and gap in the dialog. Default 32px and 8px. |
.mage-ways-to-earn__grid {
--mage-wte-columns-lg: 4;
--mage-wte-gap: 24px;
--mage-wte-card-aspect: 4 / 3;
}Ways to Redeem
Root: .mage-ways-to-redeem.
Part | Classes |
Layout |
|
Card |
|
Media |
|
Text and button |
|
Progress and empty |
|
VIP Tier Benefits
Container ID: #mage-vip-tier-benefits. The block has two layouts, chosen in the app under VIP Tier Benefits Table: Table uses the mage-tiers-table classes and Cards uses the mage-tiers-cards classes. The progress section uses the mage-tiers-table__progress classes in both layouts.
Table layout (root .mage-tiers-table)
Part | Classes |
Layout |
|
Tier headers |
|
Rows and cells |
|
Progress section (signed-in customers)
Part | Classes |
Heading |
|
Bar |
|
Other |
|
The tier headers and value cells carry a data-tier-index attribute (0 for the first tier, counting left to right), so you can style a single column:
.mage-tiers-table__tier-header[data-tier-index='0'],
.mage-tiers-table__value-cell[data-tier-index='0'] {
background-color: #f5f0eb !important;
}
Cards layout (root .mage-tiers-cards)
Part | Classes |
Banner and header |
|
Cards |
|
Images |
|
Benefits |
|
Carousel dots |
|
Each card carries data-tier-index (0 for the first tier), data-position, and data-active="true" on the customer's current tier. The grid carries data-card-style set to banner or icon.
.mage-tiers-cards__card[data-tier-index='0'] .mage-tiers-cards__hero {
background: linear-gradient(155deg, #e9cba3, #8a5a2d) !important;
}To fade the cards in as they scroll into view, add --mage-card-reveal: on to .mage-tiers-cards__grid in Custom CSS. It is off by default.
FAQ
Root: .mage-faq.
Part | Classes |
Layout |
|
Question |
|
Icons |
|
Answer |
|
The Product Points Calculator is a product page block, not a landing page block. See Styling Your Product Points Calculator.
Dialog Reference
Dialogs open on top of the page when a customer clicks a card. They are not inside the block's root element, so target them by their own classes. The Ways to Earn and Ways to Redeem Custom CSS fields in the app suggest these classes in autocomplete. In the tables, __ and -- names are added to the prefix or root shown.
Shared dialog frame
Prefix: mage-block-dialog
Part | Classes |
Frame |
|
Header |
|
Body and footer |
|
Earn dialog
Prefix: mage-block-dialog-earn. Shown when a customer clicks a Ways to Earn card. The birthday, receipt and photo dialogs reuse these classes for their summary, buttons and result messages.
Part | Classes |
Summary |
|
Buttons |
|
Success and result |
|
Confirmation |
|
Birthday dialog
Prefix: mage-block-dialog-earn-birthday
Part | Classes |
Form |
|
Receipt upload dialog
Prefix: mage-block-dialog-earn-receipt
Part | Classes |
Upload area |
|
Preview |
|
Processing |
|
Error and result |
|
Photo challenge dialog
Root: .mage-block-dialog-earn-photo (the dialog content root)
Part | Classes |
Content |
|
Upload area |
|
Preview |
|
Uploading and error |
|
Redeem dialog
Prefix: mage-block-dialog-redeem. Shown when a customer clicks a Ways to Redeem card.
Part | Classes |
Reward |
|
Requirements |
|
Variant picker |
|
Points |
|
Buttons |
|
Result |
|
Flexible amount rewards |
|
To hide a requirement line:
.mage-block-dialog-redeem__requirement--max-shipping {
display: none !important;
}Flexible Redemption dialog
Root: .mage-flexible-redemption-apply-dialog. Shown when a customer redeems from the Flexible Redemption block. The main classes are listed below. The Flexible Redemption Custom CSS field in the app suggests the full set in autocomplete.
Part | Classes |
Header |
|
Discount |
|
Buttons |
|
Login dialog
Prefix: mage-block-dialog-login. Shown to guests who click something that needs an account.
Part | Classes |
Content |
|
Common Mistakes to Avoid
Colour rules that do nothing. Theme editor colours are inline styles. Tick Disable Customizer Styles on the block, or add !important to your colour rules.
Styling a dialog from inside the block. Dialogs are not inside the block's root element, so a selector such as .mage-ways-to-earn .mage-block-dialog-earn__button never matches. Use the dialog class on its own.
Using the old Points Overview or Refer a Friend classes. mage-points-overview is now mage-activity-overview, and the old mage-refer block no longer exists. Update any saved CSS that still uses them.
Troubleshooting
My CSS is not showing on the storefront
Check that you saved the section in the app after editing the Custom CSS.
Check the size meter under the editor. CSS over 64 KB cannot be saved.
Check that the block is added to the page in the theme editor. A block's app CSS only loads on pages where that block is present.
Check your selector with your browser's inspect tool to make sure the class is on the element.
