Theme files
About 792 words
A theme file is a YAML document that defines colors for dark and light terminals, a border style and a glyph set. This page lists every field. For a walkthrough, see the themes guide.
The JSON schema is published at https://unifi-cli.specht-labs.de/schema/theme.schema.json and printed by unifi config schema theme. Unknown fields are an error, so a typo in a token name is reported when the theme loads.
Fields
| Field | Type | Description |
|---|---|---|
apiVersion | string | unifi.specht-labs.de/v1alpha1 |
kind | string | Theme |
name | string | The theme's name. Defaults to the file name without .yaml. |
description | string | One line shown by unifi theme get. |
extends | string | Name of a theme whose values this one inherits. Chains of up to eight themes are followed. |
palette | map of name to color | Named colors that tokens reference as p:<name>. Merged over the extended theme's palette. |
border | string | Border style; see Borders. |
glyphs | string | Glyph set; see Glyph sets. |
dark | tokens | Tokens for dark terminals. |
light | tokens | Tokens for light terminals. |
Every field is optional. What a file leaves out comes from the theme it extends, and what the whole chain leaves out comes from the default theme, unifi, so a partial theme always renders.
Color values
A token or palette entry takes one of two forms:
| Form | Example | Meaning |
|---|---|---|
| Hex color | "#88C0D0" | A color as #RRGGBB. Quote it, because # starts a YAML comment. |
| Palette reference | p:nord8 | The palette entry of that name, from this file or an extended theme. |
Short hex (#abc), named colors and ANSI color numbers aren't accepted. A reference to a palette name that isn't defined is an error.
On terminals without 24-bit color, the colors are reduced to the nearest ones the terminal supports.
Tokens
The dark and light blocks take the same tokens.
| Token | Colors |
|---|---|
background | The terminal background the scheme is designed for. unifi theme preview paints it behind the sample. |
surface | The fill of raised elements such as badges. |
border | Borders and rules. |
text | Primary text. |
muted | Secondary text, such as table headers and labels. |
subtle | The least important marks. |
primary | The brand color. |
secondary | The second accent. |
success | Healthy state. |
warning | Degraded state. |
danger | Failed state. |
info | Neutral highlights. |
series | A list of colors for chart series, in order. The built-in themes define eight. Setting it replaces the inherited list as a whole. |
Borders
| Value | Corners and lines |
|---|---|
rounded | ╭─╮ (default) |
square | ┌─┐ |
thick | ┏━┓ |
double | ╔═╗ |
ascii | +-+ |
Glyph sets
| Glyph | unicode | ascii |
|---|---|---|
| State dot, empty dot | ● ○ | * o |
| Check, cross, warning | ✓ ✗ ▲ | + x ! |
| Bullet, separator | • · | - | |
| Arrows up, down, right | ↑ ↓ → | ^ v > |
| Ellipsis | … | ~ |
| Bar full, empty | █ ░ | # . |
| Sparkline levels | ▁▂▃▄▅▆▇█ | _.-=+*## |
| Heatmap shades | ░▒▓█ | .:=# |
| Graphs | braille dots, for sub-cell resolution | no braille |
| PoE, wireless | ϟ ≈ | p on a faceplate, z elsewhere; ~ |
| Tree guides | ├─ └─ │ | |- `- | |
| Rules | ─ ━ | - = |
| Dashed lines | ┄ ┆ | . : |
| Link speed, slowest to fastest | ▂ ▄ ▆ █ | - + = # |
| Port down, disabled | □ × | . x |
The ascii set also switches the border to the ascii style, whatever border says, so the output holds nothing but 7-bit characters. The glyphs preference in the configuration file overrides the theme's choice.
Built-in themes
| Name | Description |
|---|---|
unifi | The default theme, modeled on the UniFi Network console |
catppuccin | Catppuccin Mocha on dark and Latte on light terminals |
dracula | Dracula, with the Alucard palette on light terminals |
gruvbox | Warm, earthy contrast |
mono | Greyscale; state is told apart by lightness alone |
nord | Polar Night on dark and Snow Storm on light terminals |
solarized | Solarized Dark and Light |
tokyo-night | Tokyo Night, with Tokyo Night Day on light terminals |
unifi theme get <name> prints a built-in theme's complete definition.
The default theme
This is unifi, the theme every other one ultimately falls back to:
apiVersion: unifi.specht-labs.de/v1alpha1
kind: Theme
name: unifi
description: The default theme, modeled on the UniFi Network console
border: rounded
glyphs: unicode
palette:
blue: "#006FFF"
blue-bright: "#4797FF"
aqua: "#38CCCC"
teal: "#00838F"
purple: "#A259FF"
green: "#39CC64"
amber: "#F5A524"
red: "#F0383B"
dark:
background: "#0B0C0E"
surface: "#1C1E23"
border: "#42454D"
text: "#F4F5F6"
muted: "#9EA2AB"
subtle: "#555963"
primary: p:blue-bright
secondary: p:aqua
success: p:green
warning: p:amber
danger: p:red
info: p:blue-bright
series: ["p:blue-bright", "p:aqua", "p:purple", "p:amber", "p:green", "#F0527A", "#8FA2FF", "#C8D12C"]
light:
background: "#FFFFFF"
surface: "#EEF0F3"
border: "#BFC3CB"
text: "#16181D"
muted: "#5F6470"
subtle: "#A5A9B2"
primary: p:blue
secondary: p:teal
success: "#1A8F3C"
warning: "#B26A00"
danger: "#D32F2F"
info: p:blue
series: ["p:blue", "p:teal", "#7B2FD6", "#B26A00", "#1A8F3C", "#C2185B", "#3F51B5", "#7A8500"]Lookup order
A theme name resolves to <name>.yaml in the themes directory first, and to a built-in theme second. A file named like a built-in theme replaces it. unifi theme path prints the directory.
