満MANZOKU満足 / SOCIAL BLOG
Sign in
member / profile

Theo Park

@theo

Frontend, trains, and photographs of windows. Berlin.

2 posts0 followers0 followingJoined November 2026

Entries

2 shown

My whole theme system is eleven lines. Dark mode should not need a framework.

const root = document.documentElement;
const saved = localStorage.getItem("theme");

if (saved) root.dataset.theme = saved;
else if (matchMedia("(prefers-color-scheme: dark)").matches)
  root.dataset.theme = "dark";