mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-14 06:40:50 +00:00
fix(pwa): follow the app's theme in the browser bar and toasts, lift toasts over the bottom bar
The theme-color tags followed the operating system's scheme, while the app's theme is its own setting and defaults to dark: a phone in light mode showed a light address bar or status bar over the dark app. The client now rewrites both tags to the theme the page painted. The toaster read Sonner's "system" for the same reason and now gets the resolved theme as well. Below 600 px Sonner stacks toasts 16 px above the bottom edge, which on a phone is on top of the bottom bar: the "new version" hint covered the tabs and the add button until dismissed. A mobile offset lifts toasts above the bar and the home indicator. pwa-mobile.spec.ts covers the hint's position and its Reload, a bottom sheet standing on a stand-in keyboard, 16 px fields in portrait and held sideways, and the sign-in card held sideways.
This commit is contained in:
1 parent
a4ad8ebe92
commit
2cd68779ec
6 files changed
+357
-7
No files matched your search
@@ -12,10 +12,9 @@ import { Toaster as Sonner, type ToasterProps } from "sonner";
|
||||
const Toaster = ({ ...props }: ToasterProps) => {
|
||||
return (
|
||||
<Sonner
|
||||
// `theme="system"` lets Sonner match the resolved theme on the
|
||||
// root element (set pre-paint by the inline theme script in
|
||||
// `app/layout.tsx`) instead of pinning dark — on light-mode the
|
||||
// hardcoded dark toaster contrasted badly against the page.
|
||||
// A fallback only: Sonner's `"system"` follows the operating
|
||||
// system's scheme, not the app's theme, so the app's toaster passes
|
||||
// its resolved theme (`AppToaster` in `providers.tsx`).
|
||||
theme="system"
|
||||
className="toaster group"
|
||||
icons={{
|
||||
|
||||
Reference in new issue
Block a user