Skip to content

Instantly share code, notes, and snippets.

View danimydev's full-sized avatar

Daniel Madrid danimydev

View GitHub Profile
@danimydev
danimydev / theme-provider.tsx
Last active May 15, 2025 05:47
tauri / preact / shadcn / tailwinds theme-provider
import { getCurrentWindow, Theme } from "@tauri-apps/api/window";
import { ComponentChildren, createContext } from "preact";
import { useEffect, useState } from "preact/hooks";
const ThemeProviderContext = createContext<{
theme: Theme;
}>({
theme: "light",
});