How to customize Flair with CSS | Flair

How to customize Flair with CSS

Oct 19, 2026

On this page

This guide covers common CSS recipes for adjusting how Flair looks on your store.

For the full list of CSS custom properties, see Web Components.

How to add CSS to your Shopify theme

There are two common ways to add CSS:

Set font size on mobile

Adjust the 12px and 16px values to match your preferences.

Badges:

@media only screen and (max-width: 480px) {
  flair-badges { --flair-font-size: 12px; --flair-line-height: 16px; }
}Copied!

Banners:

@media only screen and (max-width: 480px) {
  flair-banners { --flair-font-size: 12px; --flair-line-height: 16px; }
}Copied!

Set font size on desktop

Adjust the 12px and 16px values to match your preferences.

Badges:

flair-badges { --flair-font-size: 12px; --flair-line-height: 16px; }Copied!

Banners:

flair-banners { --flair-font-size: 12px; --flair-line-height: 16px; }Copied!

Center on mobile

Badges in a row:

@media only screen and (max-width: 480px) {
  flair-badges { --flair-layout-direction: row; --flair-layout-justify-content: center; }
}Copied!

Badges in a column:

@media only screen and (max-width: 480px) {
  flair-badges { --flair-layout-direction: column; --flair-layout-align-items: center; }
}Copied!

Center on desktop

Badges in a row:

flair-badges { --flair-layout-direction: row; --flair-layout-justify-content: center; }Copied!

Badges in a column:

flair-badges { --flair-layout-direction: column; --flair-layout-align-items: center; }Copied!

Hide on mobile

Badges:

@media only screen and (max-width: 480px) {
  flair-badges { --flair-layout-display: none; }
}Copied!

Banners:

@media only screen and (max-width: 480px) {
  flair-banners { --flair-layout-display: none; }
}Copied!

Hide on desktop

Badges:

@media only screen and (min-width: 480px) {
  flair-badges { --flair-layout-display: none; }
}Copied!

Banners:

@media only screen and (min-width: 480px) {
  flair-banners { --flair-layout-display: none; }
}Copied!

Allow badge text to wrap

For square and round badge shapes only:

flair-badges { --flair-white-space: normal; }Copied!

Make banners full width in Horizon themes

In Horizon-family themes, a banner added as an app block doesn't stretch to the full width of its section. This CSS makes it full width:

.shopify-app-block:has(> flair-banners) { align-self: stretch; }Copied!

Related guides

Navigation

Closecross-small