Skip to content

This how-to is for builders and tenant administrators. You will give OSOS your organization’s look: your colours in light and dark mode, your corporate font, and a matching sign-in page. You do most of it with one CSS file attached to a theme, by overriding the CSS variables the web app is built on.

You need:

  • At least Developer access at the system level, with Edit, so you can add themes and fonts under Administration › Interfaces. See Look and feel.
  • Your brand colours as hex values, and your font in WOFF, WOFF2, TTF and OTF.
  • A text editor to write a .css file.
  • For the sign-in page: your platform operator, who applies its CSS for you.

How to add a theme or a font, and how to offer a theme to people, is on Look and feel: themes, fonts and icons. This page builds on it.

The web app’s look comes in layers. Each layer can override the one before it:

  1. The base theme. Your deployment ships with a built-in base theme. It defines every colour as a CSS variable, in a light set and a dark set. Your operator chooses the base theme; you cannot change it in Administration.
  2. Your theme’s General CSS. A CSS file you attach to a theme. The web app loads it after the base theme, so whatever it sets wins.
  3. CSS on a view, a page or a widget. Styles for one screen only. See Style a view with custom CSS.

Which theme’s General CSS someone gets depends on the theme they use: the one they picked under Theme in Quick Settings, or otherwise the Default Theme of the settings record that applies to them. The file is loaded when the app starts. If the file is empty or cannot be loaded, people get the base theme.

The sign-in page is a separate page with its own, much shorter, set of variables. A theme does not change it. See Brand the sign-in page.

  1. Write your CSS file, for example contoso.css. Start from the worked example below.
  2. Open Administration › Interfaces › Themes, then select Add Theme, or open an existing theme and edit it.
  3. Fill in Theme Name. Turn on Dark mode if this is a dark theme.
  4. Under General CSS, upload your CSS file.
  5. Select Save.
  6. Offer the theme in a settings record, as Default Theme or under Available Themes. See Choose which themes people can use.
  7. Reload the web app. To try the theme yourself first, pick it under Theme in Quick Settings (the gear button at the edge of the screen).

To change the CSS later, upload a new file to the same theme and save. People get it the next time they load the app.

The web app switches between a light and a dark colour set by adding the class dark-mode to the page’s root <html> element. People choose Light or Dark under Mode in Quick Settings. When someone picks a theme whose Dark mode is on, the app switches to Dark for them.

In your CSS:

  • Put light-mode values in a :root rule.
  • Put dark-mode values in a :root.dark-mode rule.

Use :root.dark-mode, not .dark-mode on its own. The base theme declares its dark colours on .dark-mode, and a plain :root rule in your file would override them, so your light colours would also show in dark mode. The :root.dark-mode selector is more specific, so your dark values win in dark mode.

You can make one theme that looks right in both modes, or two themes (one with Dark mode on), each with its own file.

These are the variables the base theme defines that change the most of the screen. Colours you do not set keep the base theme’s value.

VariableWhat it changes
--color-primaryYour main brand colour: primary buttons, links, active menu items, highlights, the loading indicator. --primary-color follows it automatically.
--primary-colorThe same brand colour under the name most components read. Set --color-primary and leave this one alone, unless you want the two to differ.
--primaryColorRGBThe brand colour as three numbers, R, G, B (for example 10, 110, 92). Used for see-through tints of the brand colour. Set it whenever you change --color-primary.
--primary-color-textText drawn on top of the brand colour, such as the label of a primary button.
--secondary-colorThe second brand colour: secondary buttons, chips, some icons and backgrounds.
--accent-colorAn accent colour used for some headings, borders and highlights.
--textColorThe default text colour of the page body.
--text-colorThe main text colour inside components.
--text-color-secondaryQuieter text: hints, captions, labels.
--bodyBgColorThe page background behind cards and panels.
--surface-aThe background of cards, panels and menus.
--surface-bA slightly different background for alternating areas and headers.
--surface-cA light tint used as a hover background.
--surface-dDividers and outlines.
--border-colorBorders and separator lines.
--topbar-bgThe top bar’s background.
--menu-bg-colorThe main menu’s background.
--chart-color-1 to --chart-color-5The colours of dashboard charts, Kanban boards and service cards.
--font-familyThe font of the whole web app. See Use your own font.
--radiusThe roundness of corners on many elements.
--card-border-radiusThe roundness of card corners.

Uploading a font under Administration › Interfaces › Fonts stores its files, and Used font links it to a theme. The web app does not load the font by itself: you declare it in your theme’s General CSS, and then use it.

  1. Upload the font. See Add a font.
  2. Open the font from the Fonts list. The address in your browser now contains /entries/ followed by the font’s id. Copy the id.
  3. In your General CSS, declare the font with @font-face. You choose the font-family name; it does not have to match the Font name you gave it. Point src at the font file address: https://<your web app address>/api/v1/fonts/files/<font id>/<format>, where <format> is woff2, woff, ttf or otf.
  4. Put your font first in --font-family, followed by fallbacks.

Use full addresses (starting with https://) for fonts, images and anything else your General CSS loads. The web app loads the file in a way that makes relative addresses such as /api/... fail.

@font-face {
font-family: "Contoso Sans";
src: url("https://apps.contoso.example/api/v1/fonts/files/3f2c9a1e-0000-0000-0000-000000000000/woff2") format("woff2"),
url("https://apps.contoso.example/api/v1/fonts/files/3f2c9a1e-0000-0000-0000-000000000000/woff") format("woff");
font-weight: normal;
font-style: normal;
font-display: swap;
}
:root {
--font-family: "Contoso Sans", Roboto, Tajawal, system-ui, sans-serif;
}

If your font has no Arabic letters, keep an Arabic font such as Tajawal in the fallback list. The browser uses it for any letter your font does not have.

The web app sets dir="rtl" or dir="ltr" on the <html> element, from the direction of the language the person is using, and lang to the language’s code. Write your CSS so it works both ways:

  • Prefer variables. A colour or font set through a variable is the same in both directions.
  • Use logical properties for anything with a side: margin-inline-start instead of margin-left, padding-inline-end instead of padding-right, border-inline-start, inset-inline-start, and text-align: start. They flip by themselves in right-to-left languages.
  • Target a direction only when you must, with [dir="rtl"]. For a language-specific font, target the language: :root[lang="ar"].
/* A different font for Arabic */
:root[lang="ar"] {
--font-family: Tajawal, system-ui, sans-serif;
}

The sign-in page, and the other pages around it (password reset, sign-in codes), are served by the identity service, not the web app. They have their own name, logo, favicon and CSS. None of it is set in Administration: your platform operator sets it, for your whole deployment or for your organization only. On a shared deployment, the name, logo and favicon come from your organization’s brand. See Your organization’s name, logo and sign-in page.

What you can do is prepare the CSS and give it to your operator. There are three CSS settings:

SettingWhat it isWhen it applies
variablesCssA :root rule that sets the sign-in page’s variables.Always. Loaded after the built-in variables, so your values win.
customCssAny extra CSS.Always, in both directions. Loaded after the built-in style sheet.
customCssRtlExtra CSS for right-to-left languages.Only when the page is shown in a right-to-left language. Loaded after the built-in right-to-left style sheet.

In a right-to-left language the page also loads its built-in right-to-left style sheet after customCss. If a rule in customCss is overridden there, repeat it in customCssRtl.

VariableWhat it changesBuilt-in value
--goldThe accent colour: the sign-in button, input focus borders, checkboxes, links such as the forgotten-password link, and accent lines.#d82233
--grayThe page background colour, behind the background image.#f8f8f8
--bgThe background image.url('/users-assets/bg.jpg')
--darkHeadings and dark text.#212121
--dark-grayBody text and the text in input boxes.#4a4a4a
--border-colorInput borders and input icons.#d8d8d8
--label-colorHelp text under the form.#9c9c9c
--ico-widthThe width of the icons inside input boxes.40px
--main-font-familyThe font in left-to-right languages. tahoma is always added as a fallback.tahoma
--rtl-font-familyThe font in right-to-left languages. Tajawal is always added as a fallback.Tajawal

The accent variable is called --gold for historical reasons. Since 1.10 its built-in value is red, #d82233. If your sign-in page used to rely on the old gold default, set --gold explicitly. Since 1.10

The fonts the sign-in page already has are Tajawal, Frutiger and Roboto, plus the fonts installed on the visitor’s device.

Contoso uses a deep green as its main colour, a slate grey as its second colour, a warm gold accent, and its own font, Contoso Sans. Its people work in English and Arabic, and many use dark mode.

1. The theme’s General CSS (contoso.css, uploaded to a theme named Contoso):

/* Contoso brand: web app */
@font-face {
font-family: "Contoso Sans";
src: url("https://apps.contoso.example/api/v1/fonts/files/3f2c9a1e-0000-0000-0000-000000000000/woff2") format("woff2"),
url("https://apps.contoso.example/api/v1/fonts/files/3f2c9a1e-0000-0000-0000-000000000000/woff") format("woff");
font-display: swap;
}
/* Light mode, and the values both modes share */
:root {
--color-primary: #0a6e5c;
--primaryColorRGB: 10, 110, 92;
--primary-color-text: #ffffff;
--secondary-color: #3d4a57;
--accent-color: #c8963e;
--textColor: #1f2933;
--text-color: #1f2933;
--text-color-secondary: #52606d;
--bodyBgColor: #f3f6f5;
--surface-a: #ffffff;
--surface-b: #f8faf9;
--border-color: #e1e7e5;
--topbar-bg: #ffffff;
--menu-bg-color: #ffffff;
--chart-color-1: #0a6e5c;
--chart-color-2: #3d4a57;
--chart-color-3: #c8963e;
--chart-color-4: #7fb8a8;
--chart-color-5: #9aa5b1;
--font-family: "Contoso Sans", Roboto, Tajawal, system-ui, sans-serif;
--radius: 6px;
}
/* Dark mode */
:root.dark-mode {
--primary-color-text: #0b1512;
--textColor: rgba(255, 255, 255, 0.87);
--text-color: rgba(255, 255, 255, 0.87);
--text-color-secondary: rgba(255, 255, 255, 0.6);
--bodyBgColor: #141c1a;
--surface-a: #1b2522;
--surface-b: #111816;
--border-color: #2b3835;
--topbar-bg: #1b2522;
--menu-bg-color: #1b2522;
}
/* Arabic: Contoso Sans has no Arabic letters */
:root[lang="ar"] {
--font-family: Tajawal, system-ui, sans-serif;
}

2. The settings. Offer Contoso as the Default Theme in the organization’s settings record.

3. The sign-in page. Send your operator these three values for your organization:

variablesCss, with no quotation marks:

:root {
--gold: #0a6e5c;
--gray: #f3f6f5;
--dark: #1f2933;
--dark-gray: #3d4a57;
--border-color: #e1e7e5;
--label-color: #52606d;
--bg: none;
--main-font-family: Roboto;
--rtl-font-family: Tajawal;
}

customCss, which rounds the sign-in card and its buttons to match the web app:

.card {
border-radius: 6px;
}
.btn-gold {
border-radius: 6px;
}

customCssRtl, which gives Arabic headings a little more room:

.card h1 {
line-height: 1.6;
}

Ask the operator to set your logo and favicon at the same time.

4. Check it. Reload the web app and check a list, a form and a dashboard in Light and Dark mode, in English and in Arabic. Then sign out and look at the sign-in page in both languages.

A theme also has an Application Shell field. It is reserved for a future feature and changes nothing people see today. See Application shells.

What you seeWhat to check
Nothing changed after you uploaded the CSS.Reload the page. Check that the people concerned use this theme: it is their Default Theme, or they picked it in Quick Settings.
Your font does not show.The src addresses must be full addresses starting with https://. Check the font id and that the format you name was uploaded.
Your light colours also show in dark mode.Put the dark values in a :root.dark-mode rule, not .dark-mode.
Some hover colours still use the old brand colour.Those shades are fixed when OSOS is built. Override the element’s colour directly.
The mobile app does not use your colours.General CSS styles the web app only. See Override mobile app colours.
A font on the sign-in page does not apply.In variablesCss, write the font name without quotation marks.

Platform 1.10.0 · Backend 1.11.0-alpha.11 · Frontend 1.11.0-alpha.6 · Mobile 1.10.2 · Chart 1.11.8 · Gateway 2.6.11 · MCP 0.2.0 · Grafana DS 1.2.0Docs build 2026-11-27