Skip to content

Commit

Permalink
docs: added an example of creating custom Mermaid styles (slidevjs#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
estruyf authored Feb 3, 2023
1 parent fcb11d1 commit e1c823d
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions custom/config-mermaid.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,33 @@ export default defineMermaidSetup(() => {
```

With the setup, you can provide a custom default setting for [Mermaid](https://mermaid-js.github.io/). Refer to the type definitions and its documentation for more details.

## Custom theme/styles

In case you want to create your custom Mermaid themes or styles, you can do this by defining `themeVariables` like in the following example:

```ts
import { defineMermaidSetup } from '@slidev/types'

export default defineMermaidSetup(() => {
return {
theme: 'base',
themeVariables: {
// General theme variables
noteBkgColor: "#181d29",
noteTextColor: "#F3EFF5cc",
noteBorderColor: "#404551",

// Sequence diagram variables
actorBkg: "#0E131F",
actorBorder: "#44FFD2",
actorTextColor: "#F3EFF5",
actorLineColor: "#F3EFF5",
signalColor: "#F3EFF5",
signalTextColor: "#F3EFF5",
}
}
})
```

You can find all theme variables on the [Mermaid Theme Configuration](https://mermaid.js.org/config/theming.html) page.

0 comments on commit e1c823d

Please sign in to comment.