light and dark — that you can activate at initialization or switch at any point while the editor is running. Both themes are implemented entirely through CSS classes applied to the editor’s root element, which means you can layer your own styles on top without touching any JavaScript.
Setting the initial theme
Pass thetheme key in the options object when you create the editor instance. The value must be either 'light' or 'dark':
theme option, the editor defaults to 'light'.
Lumen Editor’s theme stylesheet must be imported in your project for the built-in themes to render correctly. Add
import 'lumen-editor/dist/theme.css' (or the equivalent <link> tag) before you mount the editor.Switching themes at runtime
You can change the active theme at any time — for example, in response to a user toggling a dark-mode preference — by callingsetTheme() on the editor instance:
setTheme() updates the CSS class on the editor’s root element immediately. No re-initialization or content reload is required.
CSS customization
When a theme is active, Lumen Editor adds one of two classes to its root element:| Theme | Class applied |
|---|---|
light | lumen-editor--light |
dark | lumen-editor--dark |