mirror of
https://github.com/ChenQihan666/MyBlog-Next.git
synced 2026-08-14 07:33:07 +08:00
feat: add callout support (#655)
* feat: toggle .dark class on theme change * feat: add callouts with rehype-callouts plugin * docs: update blog posts with callouts
This commit is contained in:
@@ -106,7 +106,9 @@ const rssHref = getRelativeLocaleUrl(
|
||||
"(prefers-color-scheme: dark)"
|
||||
).matches;
|
||||
const theme = stored ?? (prefersDark ? "dark" : "light");
|
||||
document.firstElementChild?.setAttribute("data-theme", theme);
|
||||
const root = document.firstElementChild;
|
||||
root?.setAttribute("data-theme", theme);
|
||||
root?.classList.toggle("dark", theme === "dark");
|
||||
// Expose value so theme.ts can skip re-detection.
|
||||
window.__theme = { value: theme };
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user