# Theming and white-label

Source: https://mroffice.ai/en/developers/embed/theming

Make the editor look like your product: your accent and background colours, font, corner radius, density, logo and product name. White-label theming is part of the Pro plan and above; on Free and Starter the editor keeps MR Office's look (a colour scheme, light, dark or system, works on every plan).

Two places set a theme, merged key by key: the app's Theme tab in the developer console (applies to every session) and the page's ui.theme / ui.brandName (per page, wins). MR Office checks both on its server before the editor applies anything: an app whose plan does not include white-label gets onError embed_white_label_not_in_plan (not fatal) and MR Office's look.

| ui.theme | Value |
| --- | --- |
| colorScheme | "light", "dark" or "system" (follow the device). |
| accent | #rrggbb: buttons, links, the selected tab and the selection. |
| background | #rrggbb: the editor's ground around the document (light scheme). |
| dark | { accent, background } for the dark scheme (default: the accent's hue, made to read on dark). |
| fontFamily | The interface's font, one the editor serves on every page: Plus Jakarta Sans (MR Office's), system-ui, Aptos, Segoe UI, Arial, Helvetica, Verdana, Tahoma, Trebuchet MS, Fira Sans, Barlow, Selawik, Calibri, Georgia, Cambria, Times New Roman. |
| radius | Corner radius of controls and panels, 0–16 px (default 8). |
| density | "compact" (desktop-sized controls) or "comfortable" (touch-sized); unset: touch-sized on touch screens. |
| logoUrl | https URL of a PNG, JPEG, GIF, WebP or SVG of at most 256 KB, shown while the editor opens. |
| ui.brandName | Your product's name (60 characters), shown where the editor would say MR Office: its loading screen and the tab's title. |

A white-label theme:

```js
MROffice.open({
  container: "#editor",
  token,
  ui: {
    brandName: "Acme Docs",                 // where the editor would name MR Office
    theme: {
      colorScheme: "system",                // "light" | "dark" | "system"
      accent: "#0057d9",                    // buttons, links, the selected tab
      background: "#f5f7fb",                // the editor's ground (light)
      dark: { accent: "#7aa7ff", background: "#101418" },
      fontFamily: "Segoe UI",               // one of the families below
      radius: 6,                            // 0–16 px
      density: "comfortable",               // "compact" | "comfortable" (touch-sized controls)
      logoUrl: "https://cdn.acme.example/logo.svg",
    },
  },
  onError: (error) => {
    // embed_white_label_not_in_plan, embed_theme_adjusted (not fatal)
    if (!error.fatal) console.info(error.code, error.message);
  },
});

editor.setTheme({ accent: "#b42318" });   // later: checked again, applied in place
editor.setTheme("dark");                  // a colour scheme alone, any plan
```

- Contrast is kept (WCAG 2): an accent below 4.5:1 on the editor's surfaces (or 3:1 on your background) is moved to the nearest lightness of its own hue that passes; a background the editor's secondary text does not reach 4.5:1 on is not used. onError reports embed_theme_adjusted with what changed; the high-contrast theme is never re-coloured.
- The logo is fetched by MR Office (a signed link to its logo proxy, cached an hour) and served only as the picture its bytes are; your visitors' browsers never request your URL from the editor.
- Only the editor's own colours, font and shapes change: your documents keep their own fonts and colours, and nothing you send is put in a stylesheet unchecked.
- setTheme(theme) applies a new theme in place (checked again); setTheme("dark") switches the scheme alone.

> The developer console's Theme tab previews a theme in light and dark as MR Office will apply it (with the contrast it keeps), saves it for the app, and shows the same theme as ui.theme for your page.
