---
title: Make it match your brand
summary: This page shows how to change the look of your sign-in pages and emails.
section: customize
order: 1
---
# Make it match your brand

This page shows how to change the look of your sign-in pages and emails.

Start with [themes](/docs/concepts/themes.md) if you want to know what a theme is. Everything here changes the look only. Layout, wording and security cues do not change.

## In the console

Open a realm and choose **Theme**. You can set:

- a logo, as an https address or an uploaded file
- primary, secondary, background and accent colors
- custom CSS, under **Advanced**

A live preview shows the sign-in card as you type, in a sandboxed frame. It follows your colors and your custom CSS. Colors are six-digit hex values such as `#3b5bdb`. If the custom CSS is one the server would refuse, the preview leaves it out and says why. Skins, color scheme, fonts and token overrides are not on this page: set them in a realm spec (below). **Save theme** applies it to the realm's sign-in pages.

> **Note.** Hosted sign-in pages show only logos that you upload to Tessera. A logo given only as an address is used in emails and in the account app, and the sign-in page shows the product name instead.

## Pick a skin

A skin is a complete look. Set it in a realm spec:

```yaml
theme:
  skin: pewter          # default, control, pewter, foundry or inscribed
  color_scheme: dark    # dark, light or system
  density: comfortable  # compact or comfortable
  overrides:
    accent: "#b9a698"
    signal: "#c42a33"
  brand:
    name: Acme
    logo: {dark: ./branding/logo-dark.svg, light: ./branding/logo-light.svg}
    favicon: ./branding/favicon.svg
```

Preview the result, then apply it:

```sh
tessera plan  -f acme.yaml
tessera apply -f acme.yaml
```

`plan` shows what would change and warns about contrast. `apply` stores it. Running `plan` again shows no change. You need a credential that has the theming scopes (`tessera:theming:read` and `tessera:theming:write`) on the realm. A realm-confined agent can do it for its own realm.

## Overrides

`overrides` change named parts of the skin: colors such as `accent`, `signal`, `bg` and `text`, and a few shapes such as corner radius. Rules:

- Names must be Kurth Labs Design semantic tokens. An unknown name is an error.
- Colors are hex only.
- Fonts are lists of family names.
- Add `light:` or `dark:` inside `overrides` to change one scheme only.
- Each text and background pair is checked for contrast. A pair below the WCAG minimum fails the plan.

## Brand

- `name` is the product name, up to 80 characters.
- `logo` is one file, or a pair for dark and light backgrounds. Logos and the favicon must be PNG, JPEG, GIF, WebP, ICO or SVG, up to 256 KiB each, and the file type is checked against its content. SVG is rewritten to a plain drawing: scripts, links, images and animation are removed.
- `email_logo` is an optional PNG, JPEG or GIF for email, because Gmail and Outlook do not show SVG.
- `fonts` are woff2 files you upload for `body`, `display` and `mono`, up to 16 files of 1 MiB each per theme. Tessera serves them itself.

## Custom CSS

`custom_css` is for details a skin and overrides cannot reach. It can style any element of the hosted pages, including nested rules and `@media`, `@supports`, `@container` and `@keyframes`.

```yaml
theme:
  custom_css: ".m-auth-card { max-width: 28rem; }"
```

Set it in a realm spec or under **Advanced** on the console's Theme page. It is limited to 65536 bytes (64 KiB).

CSS cannot fetch anything, and these are refused:

- `url()`, except `url("tessera-asset:<name>")`, which points at an image your theme uploaded: `logo`, `logo-light`, `favicon` or an extra image named `image-<name>`. Tessera swaps it for the file's own address. A theme can hold up to 8 extra images, each up to 512 KiB (PNG, JPEG, GIF, WebP or SVG). Upload them with the admin API (`PUT /admin/v1/realms/<realm>/theme/assets/image-<name>`) or "Match my site" below.
- `image-set(`, `image(`, `cross-fade(`, `src(`, `element(`, `paint(`, `expression(`, `@import`, `@font-face`, `@namespace`, `@layer`, `@property`, `behavior` and `-moz-binding`. For fonts, upload woff2 files and use the family name in `font-family`.
- backslashes, `<`, control characters and unbalanced braces, brackets or quotes.
- `position: fixed` and a `z-index` above 100, so nothing can cover the page's warnings.
- attribute selectors on `[value]`, and prefix, suffix or substring matches (`^=`, `$=`, `*=`) on anything except `class`, `lang`, `dir`, `type`, `role`, `rel`, `target` and `aria-*`. They could be used to guess what a person types.

Security cues are protected. These are the lines a person relies on to decide whether to continue: who is asking, where they will be sent, warnings and errors, and the device code and decision buttons. A rule that selects one and hides it (`display: none`, a tiny font, transparent text, near-zero opacity) is refused, and a guard sheet that outranks your CSS keeps them visible and legible whatever else you write.

The check runs when you save and again whenever a page renders. A save is refused with the first problem named. At render time, a rule that fails is dropped and the rest is kept. A stylesheet that is broken as a whole renders as nothing.

## Per app

An app can have its own theme, so people who sign in to it see its brand on one shared login host.

```yaml
access:
  apps:
    - key: shop
      clients: [shop-web]
      theme:
        skin: control
        brand: {name: Acme Shop}
```

A theme on a client wins over the app's, and the app's wins over the realm's. If an app names a different skin than the realm, it starts from that skin and drops the realm's token overrides. `tessera plan` prints a note when this happens.

## Match my site

Tessera can read your website and propose a theme from it, so you start from the look you already have.

```sh
tessera theme import-brand https://example.com --out proposal.json
tessera theme preview --from proposal.json
tessera theme import-brand --from proposal.json --apply
```

It works from the CLI and the admin API (`POST /admin/v1/realms/<realm>/theme/brand-import`). The console does not have a button for it yet. You need the theming scopes. Add `--client <client_id>` or `--app <id>` to target a client's or an app's theme instead of the realm's.

What it does:

- It reads the site's logo, colors, fonts and light or dark scheme, and proposes the closest skin with token overrides, plus the logo, favicon and any fonts the site serves itself (woff2 only, up to 8 faces; check you may use them).
- It fixes colors that fail the contrast check, and lists each change and any warnings.
- Nothing is stored by the first call. `--apply` with a web address prints the proposal and stops unless you also pass `--yes`. The usual route is to save with `--out`, review, then apply with `--from`. Applying checks the proposal again, like any theme write.

The fetch is careful. Only https on port 443 and only public addresses are read, with no credentials in the address and every redirect checked again. HTML and CSS are parsed and never run. One import reads at most 1 MiB of HTML, 512 KiB per stylesheet, 28 requests and 8 MiB in total, within 25 seconds. A realm can start 8 imports per 10 minutes.

## Preview before you save

`tessera theme preview` renders a proposal on the real hosted pages without storing anything. Through the admin API, `POST /admin/v1/realms/<realm>/theme/preview` does the same for any unsaved theme: a normal theme write body, plus any assets.

The answer holds one link per page: sign-in (with the realm's own sign-in methods), sign-in with an error, passkey, emailed code, emailed-link confirmation, consent, device approval and the error page. The links are read-only samples that sign no one in. Add `?scheme=dark` or `?scheme=light` to force a scheme, and check at 375, 768 and 1280 px wide. A theme the server would refuse on save, such as CSS that hides a security cue, is refused here too. The answer also lists contrast problems and security cues that fall below their minimum.

Limits:

- A link works for 15 minutes and anyone who has it can open it. It opens only on the server node that made it, so make a new preview if one gives a 404.
- At most 4 MiB of images and fonts per preview.
- A realm keeps 20 previews and 16 MiB, and can make 30 previews in 10 minutes, 15 for one person. Past the server-wide budget the answer is 429.
- Email layouts are not part of the preview.

## Where else it shows

The same theme styles invite and sign-in emails and the account app. Emails use inline styles built from the skin. A realm's color scheme applies to its emails when it is set, and a light palette otherwise.
