Skip to main content
Version: Next

@editora/themes

Built-in theme package for Editora visual surfaces.

Installation

npm i @editora/themes

API Surface

SurfaceTypeNotes
applyTheme(tokens, root?)Function exportApply theme tokens to root/container
getThemeCSS(name)Function exportReturn CSS string for a named theme
setGlobalTheme(name)Function exportApply global theme
getCurrentTheme()Function exportRead active global theme
toggleTheme()Function exportToggle between light/dark
isDarkTheme(name) / isLightTheme(name)Function exportsTheme mode checks
themesConstant exportIncludes light, dark, acme
ThemeNameType exportUnion from keys of themes
@editora/themes/themes/default.cssCSS exportDefault theme
@editora/themes/themes/dark.cssCSS exportDark theme
@editora/themes/themes/acme.cssCSS exportAcme reference theme

Usage

import "@editora/themes/themes/default.css";
import "@editora/themes/themes/dark.css";
import "@editora/themes/themes/acme.css";

dark.css and acme.css are override layers and should be loaded after default.css. If you use @editora/plugins, also load @editora/plugins/styles.css for plugin UI surfaces.

Best Practices

  • Prefer token overrides over deep selector overrides.
  • Validate dialogs/panels and floating toolbar in each theme.
  • Test multi-instance local theme scoping.

Accessibility

Check color contrast, focus states, and icon legibility in all theme modes.

Performance Notes

Keep overrides token-driven to avoid large selector cascades and expensive repaint paths.