kanban-dev-webapp/src/lib/theme/preference.ts
Dave b52d4a6287 Enhance intake link functionality and theme management
- Added `NEXT_PUBLIC_APP_URL` to `.env.example` for app URL configuration.
- Updated `README.md` to document the new `NEXT_PUBLIC_APP_URL` variable.
- Improved CSS to support light and dark color schemes.
- Refactored intake link actions to utilize the new app URL and handle token generation more efficiently.
- Enhanced public intake route to validate work area selection.
- Updated `IntakeLinksPanel` to allow copying of generated links.
- Improved error handling and user experience in `BriefPreviewPublic` and `IntakePublic` components.
- Refined theme synchronization and toggle components for better user preference management.
2026-09-22 22:24:14 +02:00

7 lines
372 B
TypeScript

export type ThemePreference = "light" | "dark" | "system";
export function applyThemePreference(root: HTMLElement, theme: ThemePreference, systemDark = false): void {
root.classList.toggle("light", theme === "light");
root.classList.toggle("dark", theme === "dark" || (theme === "system" && systemDark));
root.style.colorScheme = theme === "system" ? "" : theme;
}