Xray-docs-next/docs/.vuepress/plugins/mermaid/helpers/darkmode.ts
2024-01-31 23:04:16 -05:00

9 lines
243 B
TypeScript
Executable file

// FIXME: Should correct handle dark selector
export const getDarkmodeStatus = (): boolean => {
const html = document.documentElement;
return (
html.classList.contains("dark") ||
html.getAttribute("data-theme") === "dark"
);
};