2022-01-12 00:20:59 +00:00
|
|
|
function css(name) {
|
2022-01-13 05:22:25 +00:00
|
|
|
return "rgb(" + getComputedStyle(document.documentElement).getPropertyValue(name) + ")";
|
2022-01-12 00:20:59 +00:00
|
|
|
}
|
|
|
|
|
2023-11-26 00:43:02 +00:00
|
|
|
let isDark = document.documentElement.classList.contains("dark");
|
|
|
|
|
2022-01-12 00:20:59 +00:00
|
|
|
mermaid.initialize({
|
|
|
|
theme: "base",
|
|
|
|
themeVariables: {
|
|
|
|
background: css("--color-neutral"),
|
2023-11-26 00:43:02 +00:00
|
|
|
primaryTextColor: isDark ? css("--color-neutral-200") : css("--color-neutral-700"),
|
|
|
|
primaryColor: isDark ? css("--color-primary-700") : css("--color-primary-200"),
|
|
|
|
secondaryColor: isDark ? css("--color-secondary-700") : css("--color-secondary-200"),
|
|
|
|
tertiaryColor: isDark ? css("--color-neutral-700") : css("--color-neutral-100"),
|
|
|
|
primaryBorderColor: isDark ? css("--color-primary-500") : css("--color-primary-400"),
|
2022-01-12 00:20:59 +00:00
|
|
|
secondaryBorderColor: css("--color-secondary-400"),
|
2023-11-26 00:43:02 +00:00
|
|
|
tertiaryBorderColor: isDark ? css("--color-neutral-300") : css("--color-neutral-400"),
|
|
|
|
lineColor: isDark ? css("--color-neutral-300") : css("--color-neutral-600"),
|
2022-01-12 00:20:59 +00:00
|
|
|
fontFamily:
|
|
|
|
"ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,segoe ui,Roboto,helvetica neue,Arial,noto sans,sans-serif",
|
|
|
|
fontSize: "16px",
|
2023-11-26 00:43:02 +00:00
|
|
|
pieTitleTextSize: "19px",
|
|
|
|
pieSectionTextSize: "16px",
|
|
|
|
pieLegendTextSize: "16px",
|
|
|
|
pieStrokeWidth: "1px",
|
|
|
|
pieOuterStrokeWidth: "0.5px",
|
|
|
|
pieStrokeColor: isDark ? css("--color-neutral-300") : css("--color-neutral-400"),
|
|
|
|
pieOpacity: "1",
|
2022-01-12 00:20:59 +00:00
|
|
|
},
|
|
|
|
});
|