ZUI

Search documentation

Find a page or a heading.

Editor Theme

The editor theme contract, its default built on the design tokens, and the provider that keeps it in step with light and dark mode.

editor-theme is a library the editor surfaces read their colours from; it draws nothing of its own, so it has no preview. Document Editor installs it.

Installation

bash

Usage

tsx
tsx

EditorThemeProvider follows next-themes' resolved theme into light or dark mode, unless forcedMode fixes one. A theme holds a light and a dark variant, each naming the callout palettes, the code, diagram and formula themes. extendTheme returns a copy of a theme with the overrides merged in, and useEditorTheme() reads the theme, the mode and the variant a surface is drawn in; outside any provider it reads the default theme in light mode.