Create, import, and export a theme
- Open Settings > Appearance and select a theme close to the result you want.
- Choose Customize current theme to edit its color tokens and CSS-variable overrides.
- Choose Export current theme to save the complete palette as JSON, then edit that file if needed.
- Choose Import JSON theme and select the edited file.
mode.
JSON contract
Color values must be strings in
#RRGGBB or #RRGGBBAA format. The last pair in the eight-digit form is alpha. Shorthand hex, named colors, rgb(), var(), gradients, and arbitrary CSS values are rejected. Unknown color tokens are rejected; an empty colors object is valid. Import errors are shown instead of partially applying a theme.
The Appearance picker and extension loader enforce a configurable Theme file bytes limit on each theme file: 65,536 bytes by default, adjustable from 1,024 to 1,048,576. The extension loader also enforces a configurable Theme preview bytes limit on the aggregate JSON size of all contributed theme files loaded from one extension: 524,288 bytes by default, adjustable from 1,024 to 4,194,304. Both limits are in Settings > Advanced settings > Theme and extension limits, and the per-file limit applies independently of the aggregate limit. For portability, keep shared theme files within both limits.
Use the theme JSON schema for validation and editor completion.
Color tokens
All tokens resolve to CSS custom properties named--<token>. Pair foreground and background changes, and evaluate translucent colors after compositing them over their actual surfaces.
The built-in themes are Dark, Light, High contrast dark, and High contrast light. Their complete palettes are available in the application source.
CSS-variable overrides
The optionalvariables object can set existing application variables and new custom properties used by custom CSS. Names omit the leading --; values are CSS values, not declarations.
font-text, font-ui, font-mono, and editor-font-size. Other names are accepted but only affect the interface if a stylesheet uses them.
By default, a theme can include up to 512 overrides; each name is at most 100 characters and each value at most 2,048 characters. Names must begin with a lowercase letter and contain only lowercase letters, digits, or hyphens. Values cannot contain semicolons, braces, null bytes, url(...), or @import. Limits can be adjusted in Settings > Advanced settings > Theme and extension limits.
Variable overrides take precedence over colors and over the Appearance preferences for font-text and editor-font-size. Preferences are retained and resume when switching to a theme without those overrides. Switching themes clears prior variable overrides instead of carrying them forward.
Theme settings and metadata
A theme contributed by an extension can expose controls in Appearance without an extension script or permissions. Controls can set a color token or a property declared invariables.
px, em, rem, %, or empty. The extension-setting count limit also applies. Apply or reset values in Appearance; they persist separately for each theme ID. Export and Customize capture resolved values without live controls.
Metadata text fields allow up to 500 characters. Tags allow 20 nonempty strings of up to 40 characters each. Accessibility metadata is optional: contrast is standard or high; color-vision values are protanopia, deuteranopia, tritanopia, or achromatopsia; reduced motion is boolean; notes allow up to 1,000 characters.
Contrast pairings
A theme can declare foreground/background token pairs to document and check its readability. Results are advisory: they appear in Appearance and throughtagline.helpers.themes.contrast(theme), and never change how the theme renders.
id, an fg and bg color token, and an optional minRatio from 1 to 21 (default 4.5, the WCAG AA normal-text level; 3 suits large text and UI controls). Tagline measures the resolved colors, compositing translucent tokens over bg, and reports the ratio plus pass/fail per pair. Up to 64 pairs; the limit is adjustable in Settings > Advanced settings > Theme and extension limits. The built-in themes ship canonical pairs under ids such as body, muted, selection, and link.
Package themes in an extension
A theme-only extension needs no script. Put its manifest and theme JSON together:ext:ocean-themes:0; changing contribution order changes those IDs.
Light/dark groups. Declare contributes.themeGroups as [{"id":"ocean","title":"Ocean","light":"themes/ocean-light.json","dark":"themes/ocean-dark.json"}]. Each half gets a stable ID, ext:ocean-themes:ocean:light and ext:ocean-themes:ocean:dark, independent of order. The picker also offers Match system (ext:ocean-themes:ocean:auto), which follows the OS light/dark setting live and falls back to the built-in light or dark theme if a half is unavailable.
If a saved extension theme is still loading or unavailable, the app retains the saved selection but temporarily renders the dark palette. A disabled or removed theme appears as Unavailable extension theme.
See the extension overview, the Extension API reference, and JSON formats and schemas.