Import and Export
Last updated:
Export and import move a theme between machines as a single JSON file. Diagrams you already applied the theme to need nothing, because applying writes the colors into each file’s frontmatter (see What applying writes).
Export
Section titled “Export”-
Open the IDE settings (
Command + Comma Command, Control + Alt + S CtrlAltS ) and go to Tools > Mermaid Studio > Custom Themes. -
Select the theme in the list and click Export….
-
Choose a location and file name.
Import
Section titled “Import”-
Open the same settings page and click Import….
-
Choose the JSON file.
-
If a theme with the same id already exists, a Theme ID Conflict dialog names the existing theme and asks whether to assign a new id. Click Assign New ID to keep both, or cancel and remove the old theme first if the file is meant to replace it.
-
The imported theme appears in the list, enabled, and shows up in the Appearance menu right away.
The plugin validates the file before storing it, and a rejected file lists the problems it found. These rules matter when you hand-edit an exported file.
- Write colors as six-digit
#rrggbbhex values. - Theme ids are 3 to 50 lowercase characters (
a-z,0-9,-,_), and names are 3 to 50 characters. - The
ms-id prefix is reserved for bundled custom themes. - Keep the file under 1 MB, in a format version the installed plugin supports.
Importing preserves the theme’s id, so a diagram applied on one machine resolves to the same theme on another, and the Light/Dark toggle in the Appearance menu keeps working.
Related
Section titled “Related”- Custom Themes overview — bundled custom themes, applying, and settings
- Build a theme from your brand — create the theme you are sharing
- Remote Development — how the plugin splits between client and host