10 lines
243 B
TypeScript
Raw Normal View History

2024-01-26 05:07:42 +08:00
// FIXME: Should correct handle dark selector
export const getDarkmodeStatus = (): boolean => {
const html = document.documentElement;
return (
html.classList.contains("dark") ||
html.getAttribute("data-theme") === "dark"
);
};