Styling the blocks
How the blocks take your theme's look, the shared style settings, and the tokens a theme developer can set.
The blocks are meant to look like part of your store, not like something embedded in it. They start from your theme and you adjust from there.
Three layers
Each layer overrides the one before it.
| Layer | Where | Applies to |
|---|---|---|
| Your theme | Nothing to set | Every block follows your theme's text color and font by default |
| The app embed's Style group | App embeds, then FanBase | Every block |
| A block's own settings | That block | That block only |
Start by setting nothing. On most themes the blocks already fit. Then set an accent color in the app embed, and reach for a single block's settings only when one block sits on a different background from the rest.
The Style group
| Setting | Default | What it changes |
|---|---|---|
| Accent color | Your theme | Buttons, links, progress bars, selected states |
| Corner radius | 8 px | Corners of cards, buttons and pop-ups, 0 to 24 px |
| Spacing | 12 px | The gaps between and inside cards, 0 to 32 px |
| Text color | Your theme | All text |
| Secondary text color | Your theme | Descriptions, labels and hints |
| Border color | Your theme | Card outlines and dividers |
| Surface color | The page behind the block | The background of pop-ups and dialogs |
| Error color | Messages when something fails | |
| Success color | "Completed" and "Claimed" | |
| Focus ring color | The outline around a control reached by keyboard |
A color left empty follows your theme.
Surface color rarely needs setting. A pop-up takes the background it finds behind the block, so a dark theme gets a dark pop-up on its own.
What each block adds
Every block has its own Accent color and Corner radius, which win over the app embed for that block. A few have more:
| Block | Its own settings |
|---|---|
| Quests | Text color, glass color, card width, card height, pop-up inset |
| Account indicator | Text color, accent color, size |
The quests block has the most because its cards sit on pictures. Glass color is the frosted panel over each picture, and Text color is what is written on it. Pick the two together so the text reads on the glass.
The account indicator has its own because a header is often a different color from the page. Set its text color to match your header icons.
For theme developers
Everything in the Style group is a CSS custom property. Set them in your theme's stylesheet on any element that contains the blocks, and they apply exactly as if they had been set in the editor.
.your-rewards-page {
--fanbase-accent: #7c3aed;
--fanbase-radius: 12px;
--fanbase-gap: 16px;
}| Property | Used for |
|---|---|
--fanbase-accent | Buttons, links, progress, selected states |
--fanbase-radius | Corners |
--fanbase-gap | Spacing |
--fanbase-text | Text |
--fanbase-muted | Secondary text |
--fanbase-border | Outlines and dividers |
--fanbase-surface | Pop-up and dialog backgrounds |
--fanbase-danger | Failure messages |
--fanbase-success | "Completed" and "Claimed" |
--fanbase-focus | Keyboard focus rings |
--fanbase-font | The font family. Inherits from your theme by default. |
This is how to give one page a different look from another, or to follow a dark section of an otherwise light theme: scope the properties to that section.
A block's own editor settings still win over these, so leave a block's color settings empty if you are styling from CSS.
What is fixed
The layout of each block is part of the block. You choose colors, corners, spacing and the sizes each block exposes. You do not rearrange what is inside a card.
If your design needs a layout the blocks do not offer, that is what the React SDK is for: the same features with no markup of their own. Tell your FanBase contact what you are trying to build. Requests like that shape which options the blocks get next.
Accessibility
The blocks keep their own keyboard and screen reader behaviour whatever you set: focus rings on every control, labels for screen readers, and motion that respects a device's reduced motion setting.
Two things are yours to check after choosing colors. Text has to stay readable against whatever is behind it, most of all on the quest cards' glass. And the focus ring has to be visible on your background. Set Focus ring color if it is not.