# 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 |

## Variants

They are ordinary utilities, so 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.

```tsx
import { Frame } from "@/components/ui/frame";
import { FrameGradient } from "@/components/ui/frame-effects";

export default function GradientUtilities() {
  return (
    <Frame
      radius={10}
      line={2}
      className="w-full max-w-xs p-6 frame-from-teal-300 frame-via-indigo-300 frame-to-violet-400"
    >
      <FrameGradient angle={90} />
      <p className="font-mono text-sm">frame-via-indigo-300</p>
    </Frame>
  );
}
```

## 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 |
