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.
| Utility | Sets |
|---|---|
| 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.
<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.
<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.
| Property | Sets |
|---|---|
| --fb-line | Line width |
| --fb-line-color | Line colour |
| --fb-radius | Corner radius |
| --fb-surface | Colour behind hollow marks; defaults to --background |
| --fb-mark-color | Colour of corner marks |
| --fb-fill-color | Colour of fill patterns |
| --fb-from, --fb-via, --fb-to | Effect palette |
| --fb-duration | Effect timing |