Theming

Customize colors globally through ToffeeProvider or per-component via CSS variables.

How it works

Each tone (neutral, brand, muted) maps to a set of CSS custom properties. Components read these variables from their root element. You can override any variable globally via ToffeeProvider or locally via inline styles.

CSS Variables

VariableUsed by
--toffee-shimmer-fromShimmerText gradient start
--toffee-shimmer-midShimmerText gradient midpoint
--toffee-shimmer-toShimmerText gradient end
--toffee-pulse-bgGenerativeImage placeholder background
--toffee-pulse-highlightGenerativeImage scan-line highlight
--toffee-text-colorStreamingText, ShimmerText text color
--toffee-orb-colorThinkingOrb (Phase 2)

Global Override via ToffeeProvider

Pass a theme prop to override CSS variables for any tone:

tsx
<ToffeeProvider
  theme={{
    tones: {
      brand: {
        '--toffee-shimmer-mid': 'rgba(234, 179, 8, 0.7)',
        '--toffee-text-color': 'rgba(234, 179, 8, 0.8)',
        '--toffee-orb-color': 'rgba(234, 179, 8, 0.5)',
      },
    },
  }}
>
  {children}
</ToffeeProvider>

Per-Component Override

Override variables on a single component via the style prop:

tsx
<ShimmerText
  tone="brand"
  style={{
    '--toffee-shimmer-mid': 'rgba(16, 185, 129, 0.7)',
    '--toffee-text-color': 'rgba(16, 185, 129, 0.8)',
  } as React.CSSProperties}
>
  Custom green shimmer
</ShimmerText>

Default Tone Values

neutral
Grey / monochrome
brand
Yellow / orange
muted
Desaturated tint