We use cookies to improve your experience and analyze site traffic. By clicking "Accept", you consent to our use of cookies. See our Privacy Policy for details.

Scheduled maintenance. Thursday 29 October, 1:00–1:15 AM ET. Brief downtime; published flipbooks unaffected.

Storefront Fonts and Custom CSS

Set your storefront's heading and body fonts, and restyle it with custom CSS that keeps working as ZenFlip updates.

Storefront Fonts and Custom CSS

Your storefront can carry your brand's typography and look without any code. When you want to go further, custom CSS lets you restyle almost anything. This article covers both, and explains how to write CSS that keeps working as we improve the storefront.

Plan requirement: The storefront, including these settings, is available on Business and Enterprise plans.

Fonts

  1. Go to Settings → Storefront

  2. Find the Typography section

  3. Choose a Heading font and a Body font

  4. Click Save

The body font applies to the whole storefront. The heading font applies to headings, section titles and the hero title; if you leave it on Same as body font, headings use the body font too. You can see both in the preview before saving.

To give navigation links a different font, use Navigation Style, just below Typography. A font set there takes priority over the body font for links in the header and footer.

Your brand colour is set once, under Settings → Branding → Brand Colors, and is used for buttons, links and highlights throughout the storefront.

Custom CSS

For anything the settings don't cover, add CSS in Settings → Storefront → Custom CSS.

Write against hooks and tokens, not class names

Every part of the storefront you are likely to restyle carries a named hook, a data-zf attribute, and a few theme values are exposed as CSS variables (tokens). These are the supported way to style your storefront. We keep them stable, and a change to one is treated as a breaking change.

Everything else on the page, such as class names like .bg-teal or .text-xs and the way elements are nested, is internal. It can change in any update, and CSS that relies on it may stop applying without warning.

`css / Supported: keeps working / [data-zf="hero-overlay"] { background-image: linear-gradient(145deg, #2a1f18, #1a1510); }

/ Not supported: may break in any update / section.relative > div.absolute { background-image: linear-gradient(145deg, #2a1f18, #1a1510); } `

Tokens

Set a token on [data-zf="store"] and the storefront uses your value everywhere it applies:

Token

What it controls

Default

--zf-accent

Buttons, links, badges and highlights

Your brand colour

--zf-accent-hover

The accent colour on hover

A slightly darker --zf-accent

--zf-accent-text

The accent when it is used as text: links, labels, "Browse all"

Same as --zf-accent

--zf-font-body

Text throughout the storefront

Your Body font

--zf-font-heading

Headings, section titles and the hero title

Your Heading font

--zf-font-nav

Header and footer navigation links

Navigation Style font

--zf-bg

The page background

Your theme's background

--zf-surface

Cards, the top bar, menus and panels

Your theme's surface

--zf-surface-hover

Surfaces on hover

Your theme's hover surface

--zf-border

Borders and dividers

Your theme's border

--zf-text

Main text

Your theme's text colour

--zf-text-secondary

Supporting text

Your theme's secondary text

--zf-text-muted

Labels, captions and other quiet text

Your theme's muted text

`css [data-zf="store"] { --zf-accent: #8a9683; --zf-font-heading: 'Playfair Display', Georgia, serif; --zf-bg: #f5ede3; --zf-surface: #fdf8f3; --zf-text: #1e1a19; } `

The colour tokens apply whether a reader's device is in light or dark mode. If you change backgrounds and surfaces, set the text tokens too, so text stays readable on them.

Your theme also applies to your readers' account pages (library, shelves, wishlist, purchases, sessions) and to the sign-in, sign-up and password-reset pages. They use the same store hook and tokens; the other hooks are only on the storefront itself.

If you want a font that isn't in the Typography list, load it from Google Fonts with an @import at the very top of your CSS. Fonts from other sites are blocked by the storefront's security policy.

Hooks

Target a hook with an attribute selector, such as [data-zf="card-title"].

Hook

Element

store

The whole storefront. Set tokens here

header

The top bar

logo

Your logo and name in the top bar

nav

The navigation links group in the top bar

nav-link

Each navigation link, in the top bar and the mobile menu

library-link

The "My Library" link in the top bar

redeem-link

The "Redeem code" link, in the top bar and the mobile menu

sign-in

The "Sign in" link, in the top bar and the mobile menu

account-button

A signed-in reader's name in the top bar, which opens their menu

account-menu

The menu that opens from a signed-in reader's name

menu-button

The button that opens the mobile menu

search

The search box on the home and Browse pages

hero

The banner at the top of the home page

hero-slide

Each banner slide's background

hero-overlay

The colour or shading laid over each slide

hero-title

The banner title

hero-subtitle

The banner subtitle

hero-cta

The banner's buttons

section-title

Section headings on the home page, such as "Quarterly Issues"

card

Each publication card

card-title

A publication card's title

plan-card

Each subscription plan card, including the All-Access Pass

plan-card-title

A plan card's name

collection-card

Each collection card

collection-card-title

A collection card's title

price

The price badge on a publication card

add-to-cart

The cart button on a publication card

cart-button

The floating cart button

footer

The footer

footer-link

Each link in the footer

powered-by

The "Powered by ZenFlip" note in the footer

`css [data-zf="footer"] { background: #2a2320; } [data-zf="footer-link"] { color: #c4b5aa; letter-spacing: 0.06em; } [data-zf="card"]:hover { border-color: var(--zf-accent); } `

Tips

  • Start with the settings. A colour or font set in Branding or Typography reaches places your CSS may not, such as the mobile menu and new parts of the storefront as we add them.

  • Keep accent text readable. A light accent can look right on a button and still be too faint as text. Set --zf-accent-text to a darker shade of it; buttons keep --zf-accent.

  • Set tokens before writing rules. Changing --zf-accent recolours everything that uses the accent. A rule only changes what it selects.

  • Navigation Style applies to header and footer links. Its font, colour, case and weight are a starting point: a rule of your own on [data-zf="nav-link"] or [data-zf="footer-link"] takes priority over them.

  • Check contrast. If you change colours, make sure text stays readable against its background, especially on buttons.