Theming

Frames read their colours and sizes from custom properties, and each one has a Tailwind utility. Style a frame the way you style anything else.

Utilities

Put these on a frame to restyle every layer inside it. Colour utilities take theme colours, arbitrary values and opacity modifiers, such as frame-color-sky-500/50.

UtilitySets
frame-color-*Line colour of borders, rules and fills
frame-line-*Line width, in pixels
frame-radius-*Corner radius, from the theme or an arbitrary length
frame-mark-*Colour of corner marks
frame-fill-*Colour of fill patterns
frame-surface-*Colour painted behind hollow marks
frame-bg-*Background inside a shape frame
frame-from-*First colour of the effect layers
frame-via-*Middle colour of the effect layers
frame-to-*Last colour of the effect layers
frame-duration-*Time for one turn of a gradient or one lap of a beam, in milliseconds
section-cols-*Columns of a section grid, from 1 to 8

frame-color-sky-500/50

Variants

Because they are ordinary utilities, they work with every Tailwind variant: hover, focus, dark, breakpoints, group and peer states.

tsx
<Frame className="frame-color-zinc-300 dark:frame-color-zinc-700 hover:frame-color-sky-500">
  <FrameBorder />
</Frame>

Theming a whole section

The properties inherit, so a utility on any ancestor themes every frame beneath it.

tsx
<section className="frame-color-sky-500/40 frame-radius-lg">
  <Frame>…</Frame>
  <Frame>…</Frame>
</section>

Effect palettes

Gradient, glow and beam layers share one palette. Set it once on the frame and every effect layer inside uses it, or pass colors to a single layer.

frame-via-indigo-300

Custom properties

The utilities set these properties. You can set them yourself, in a stylesheet or a style attribute.

PropertySets
--fb-lineLine width
--fb-line-colorLine colour
--fb-radiusCorner radius
--fb-surfaceColour behind hollow marks; defaults to --background
--fb-mark-colorColour of corner marks
--fb-fill-colorColour of fill patterns
--fb-from, --fb-via, --fb-toEffect palette
--fb-durationEffect timing