Skip to content

Instantly share code, notes, and snippets.

View FedeCodeLab's full-sized avatar
🧪
Codeando a full

Federico Guzmán FedeCodeLab

🧪
Codeando a full
View GitHub Profile
@FedeCodeLab
FedeCodeLab / gist:2dcf8e1c214b18179bcfc5a4cfdf6e2f
Created October 28, 2025 23:04
Toggle Theme with Zustand
import { create } from "zustand";
type ThemeState = {
theme: "light" | "dark";
setTheme: (t: "light" | "dark") => void;
toggleTheme: () => void;
};
function applyHtmlClass(theme: "light" | "dark") {
if (typeof document !== "undefined") {