Changing for the font-size for a mermaid diagram

All plugins off, base them, no snippets and I take out the init completely and see this in the console:

mermaid.min.js:25 Uncaught Error: Unsupported color format: "var(--background-primary)"
    at Object.parse (mermaid.min.js:25)
    at Object.e.default (mermaid.min.js:25)
    at e.default (mermaid.min.js:25)
    at t.value (mermaid.min.js:25)
    at t.value (mermaid.min.js:25)
    at Object.getThemeVariables (mermaid.min.js:25)
    at bt (mermaid.min.js:25)
    at Object.updateSiteConfig (mermaid.min.js:25)
    at a (app.js:1)
    at app.js:1

Perhaps this is an actual bug? - Caching issue or similar?

Update:

Removing 'primaryColor': '#ff0000' makes it work even though this is allowed by mermaid?. Think this is a bug