Skip to main content

@microsoft/flipcard-themes

Shared design tokens for every FlipCard renderer. Ships TypeScript token objects you can consume from CSS‑in‑JS, design tools, or the FlipDeck gallery, plus the underlying CSS custom properties that power the renderers' default styling.

Install

npm install @microsoft/flipcard-themes

Tokens

import { lightTokens, darkTokens, midnightSapphireTokens, type FlipCardTokens } from '@microsoft/flipcard-themes';

lightTokens.accent; // '#2563eb'
darkTokens.surface; // '#15181d'
midnightSapphireTokens.bg; // '#060a18'

Each token set is the same shape — typed as FlipCardTokens — so you can swap themes by reference.

TokenPurpose
bgPage background behind cards.
surfaceFront‑face surface color.
text / textDimPrimary and secondary text.
borderFront‑face border.
accentBrand accent for category indicators.
radiusCard corner radius.
shadowCard elevation.
backBg / backText / backBorderBack‑face equivalents.

Themes shipped

ThemeWhen to use
lightTokensDefault light surface, blue accent.
darkTokensInverse with desaturated text and a brighter accent.
midnightSapphireTokensSaturated dark theme with a gold secondary; designed for showcase / hero usage.

CSS

The package ships matching CSS files under styles/ that map every token to a CSS custom property the renderers read. Import the one you want:

import '@microsoft/flipcard-themes/styles/light.css';
import '@microsoft/flipcard-themes/styles/dark.css';
import '@microsoft/flipcard-themes/styles/midnight-sapphire.css';

Or scope a theme to a subtree by setting the appropriate class on a wrapper element — see the getThemeClassName helper in @microsoft/flipcard (vanilla).

Customising

Because the tokens are plain objects you can:

  • Spread them to derive a brand variant ({ ...lightTokens, accent: '#ff6a00' }).
  • Feed them into a design tool exporter.
  • Override the underlying CSS variables for a slice of the page.

See also