> For the complete documentation index, see [llms.txt](https://docs.scaleflex.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.scaleflex.com/developers-headless/studio/template-builder/theming.md).

# Theming

Two attributes restyle the editor: one accent color, and a light or dark scheme.

{% hint style="info" %}
**Theming applies to the editor UI, not to the template.** Colors in the design itself live in the document and are edited through the builder. A brand color never changes what gets rendered or exported.
{% endhint %}

### Brand color

`brand-color` drives the editor's whole accent ramp - buttons, focus rings, highlights, selected states - from a single color.

```html
<sfx-template-builder brand-color="#FF6600" ...></sfx-template-builder>
```

* **It must be `#rgb` or `#rrggbb`.** Anything else is rejected and the default Scaleflex accent is kept. The value ends up inside a stylesheet rule, so the shape is enforced at the boundary rather than escaped downstream.
* **Text drawn on top of the brand color is chosen for you**, white or near-black, by contrast ratio. A pale brand color gets dark labels rather than invisible ones.
* **Surfaces, borders and body text keep the design system's neutrals.** Only the accent ramp follows your color.

{% hint style="warning" %}
**Pick a color that is readable on white.** The design system uses one accent token for both filled surfaces and link text, so a very pale brand color gives you a good-looking button and low-contrast links. Tinted accents are darkened automatically where they are unambiguously text, but a link rendered in the accent color itself cannot be - darkening it would mean not showing your brand color on the button either. Anything that passes 4.5:1 on white avoids the trade-off entirely.
{% endhint %}

### Color scheme

`theme` is `light`, `dark` or `auto`, where `auto` follows the viewer's operating system setting.

```html
<sfx-template-builder theme="dark" ...></sfx-template-builder>
```

It overrides the viewer's own stored preference, which in an embed lives in partitioned storage your page cannot reach - so setting `theme` is the only way to control the scheme from outside.

### With a security template

Project branding does not apply under a [security template](https://docs.scaleflex.com/developers-headless/studio/template-builder/authentication.md), because there is no project model to read it from. `brand-color` and `theme` are how you style a guest embed.

### Where to go next

* [API reference](https://docs.scaleflex.com/developers-headless/studio/template-builder/api-reference.md) - both attributes in the full table
* [Authentication](https://docs.scaleflex.com/developers-headless/studio/template-builder/authentication.md) - what else a guest embed does without
