Skip to content

Commit 5d6b35d

Browse files
authored
Merge pull request #348 from bonanitech/mermaid-theme
Add configuration examples for themes in Mermaid diagrams
2 parents c0b0fe9 + 9d6d556 commit 5d6b35d

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

docs/api/ui/themes/index.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ The appearance of the editor can be customised using themes. Themes are packaged
1212
and installed as Node-RED plugins, and then selected via the `editorTheme.theme`
1313
property in the settings file.
1414

15-
- [Creating theme CSS](#creating-theme-css)
16-
- [Packaging as a Theme Plugin](#packaging-as-a-theme-plugin)
17-
- [Theming the Monaco editor](#theming-the-monaco-editor)
15+
- [Creating theme CSS](#creating-theme-css)
16+
- [Packaging as a Theme Plugin](#packaging-as-a-theme-plugin)
17+
- [Theming the Monaco editor](#theming-the-monaco-editor)
18+
- [Theming the Mermaid diagrams](#theming-the-mermaid-diagrams)
1819

1920
### Creating theme CSS
2021

@@ -241,3 +242,21 @@ RED.plugins.registerPlugin("my-custom-theme", {
241242
```
242243
243244
The specific details of how to create a Monaco theme is beyond the scope of our documentation.
245+
246+
### Theming the Mermaid diagrams
247+
248+
A theme plugin can also set the theme for the Mermaid diagramming and charting tool.
249+
250+
Mermaid comes with a number of built-in themes available. The full list is [here](https://mermaid.js.org/config/theming.html#available-themes).
251+
252+
The name of the theme can be provided in the plugin settings:
253+
254+
```javascript
255+
RED.plugins.registerPlugin("my-custom-theme", {
256+
type: "node-red-theme",
257+
css: "style.css",
258+
mermaid: {
259+
theme: "dark" //Mermaid theme name
260+
}
261+
})
262+
```

docs/user-guide/runtime/configuration.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,9 @@ The theme of the editor can be changed by using the following settings object. A
237237
// The following only apply if the editor is set to "monaco"
238238
theme: "vs", // Select a color theme for the text editor component. Must match the file name of a theme in packages/node_modules/@node-red/editor-client/src/vendor/monaco/dist/theme
239239
}
240+
},
241+
mermaid: {
242+
theme: "default" // Select a color theme for the Mermaid diagramming and charting tool. Must match the name of a theme in https://mermaid.js.org/config/theming.html#available-themes
240243
}
241244
},
242245

0 commit comments

Comments
 (0)