- 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.
7 lines
372 B
TypeScript
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;
|
|
}
|