Skip to content

Editor Theming

The Elucim editor uses CSS custom properties (design tokens) for all UI chrome colors. Every color in the toolbar, inspector, timeline, and canvas overlay is driven by tokens — making the editor fully themeable.

Pass a theme prop to <ElucimEditor> with your color overrides:

import { ElucimEditor } from '@elucim/editor';
function App() {
return (
<ElucimEditor
theme={{
accent: '#e040fb',
bg: '#1e1e2e',
surface: '#181825',
fg: '#cdd6f4',
border: '#45475a',
}}
style={{ width: '100vw', height: '100vh' }}
/>
);
}

You only need to override the tokens you want to change — all others keep their defaults.

TokenDefaultDescription
accent#4a9effPrimary accent — selection highlights, active buttons
bg#1a1a2eEditor background
surface#12122aDeeper surface (minimap, nested panels)
panelrgba(22,22,42,0.93)Floating panel backgrounds
chromergba(15,23,42,0.8)UI chrome — toolbar, timeline
fg#e0e0e0Primary foreground text
text-secondary#94a3b8Secondary text (labels)
text-muted#64748bMuted text (placeholders)
text-disabled#475569Disabled text
border#334155Panel borders, dividers
border-subtle#1e293bSubtle separators
input-bg#0f172aInput field backgrounds
success#34d399Success indicators
info#4fc3f7Info indicators
error#f87171Error indicators

Tokens accept either bare names or full CSS variable names:

// These are equivalent:
theme={{ accent: '#e040fb' }}
theme={{ '--elucim-editor-accent': '#e040fb' }}

All tokens resolve to CSS custom properties with the --elucim-editor- prefix.

The editor ships with a dark theme inspired by VS Code’s dark modern palette. No configuration needed.

Dark theme (default)

Pass { 'color-scheme': 'light' } in the editor theme to switch to light mode:

<ElucimEditor editorTheme={{ 'color-scheme': 'light' }} />

Light theme

<ElucimEditor
theme={{
accent: '#cba6f7',
bg: '#1e1e2e',
surface: '#181825',
panel: 'rgba(30,30,46,0.93)',
chrome: 'rgba(24,24,37,0.8)',
fg: '#cdd6f4',
'text-secondary': '#a6adc8',
'text-muted': '#6c7086',
border: '#45475a',
'border-subtle': '#313244',
'input-bg': '#11111b',
success: '#a6e3a1',
error: '#f38ba8',
}}
/>

Use the token helpers to build custom UI that matches the editor theme:

Returns a var(--token, fallback) string for use in inline styles:

import { v } from '@elucim/editor';
const style = {
color: v('--elucim-editor-accent'),
// → 'var(--elucim-editor-accent, #4a9eff)'
borderColor: v('--elucim-editor-border'),
// → 'var(--elucim-editor-border, #334155)'
};

buildThemeVars(overrides) — Generate CSS Variable Object

Section titled “buildThemeVars(overrides) — Generate CSS Variable Object”

Merges user overrides with defaults:

import { buildThemeVars } from '@elucim/editor';
const vars = buildThemeVars({ accent: '#e040fb', bg: '#1e1e2e' });
// → {
// '--elucim-editor-accent': '#e040fb',
// '--elucim-editor-bg': '#1e1e2e',
// '--elucim-editor-surface': '#12122a',
// ... (all other defaults)
// }

The full token registry:

import { EDITOR_TOKENS } from '@elucim/editor';
// { '--elucim-editor-accent': '#4a9eff', '--elucim-editor-bg': '#1a1a2e', ... }

EDITOR_TOKENS_LIGHT — Light Mode Defaults

Section titled “EDITOR_TOKENS_LIGHT — Light Mode Defaults”

Light-mode token registry. When you pass { 'color-scheme': 'light' } in the theme, buildThemeVars() uses these as the base instead of the dark defaults:

import { EDITOR_TOKENS_LIGHT } from '@elucim/editor';
// { '--elucim-editor-accent': '#2563eb', '--elucim-editor-bg': '#f1f5f9', ... }

You can also use EDITOR_TOKENS_LIGHT to build a fully custom light theme:

<ElucimEditor
theme={{ 'color-scheme': 'light', accent: '#e040fb' }}
style={{ width: '100vw', height: '100vh' }}
/>

makeRotateCursor(color) — Themed Rotation Cursor

Section titled “makeRotateCursor(color) — Themed Rotation Cursor”

Generates an SVG data-URL cursor for the rotation handle. CSS custom properties can’t be used inside url() data URIs, so this function takes a resolved color value:

import { makeRotateCursor } from '@elucim/editor';
const cursor = makeRotateCursor('#e040fb');
// → 'url("data:image/svg+xml,...") 12 12, pointer'

The editor uses color-mix() for translucent versions of tokens. Use the same technique in custom components:

/* 20% accent with 80% transparent */
background: color-mix(in srgb, var(--elucim-editor-accent) 20%, transparent);
/* 50% border */
border-color: color-mix(in srgb, var(--elucim-editor-border) 50%, transparent);

Since the editor sets CSS custom properties on its root element, you can use them anywhere:

.my-custom-panel {
background: var(--elucim-editor-panel);
color: var(--elucim-editor-fg);
border: 1px solid var(--elucim-editor-border);
border-radius: 8px;
}