fix(toaster): render error toasts on a red surface
Error toasts previously used the same neutral popover background as success toasts, so a failure (e.g. a save while the backend is down) read like a normal 'Canvas saved'. Set sonner's per-type --error-bg/ --error-text/--error-border so errors stand out in red.
This commit is contained in:
@@ -34,6 +34,11 @@ const Toaster = ({ ...props }: ToasterProps) => {
|
||||
"--normal-text": "var(--popover-foreground)",
|
||||
"--normal-border": "var(--border)",
|
||||
"--border-radius": "var(--radius)",
|
||||
// Errors use a red surface so failures (e.g. a failed save while the
|
||||
// backend is down) stand out instead of reading like a normal toast.
|
||||
"--error-bg": "#f85149",
|
||||
"--error-text": "#ffffff",
|
||||
"--error-border": "#da3633",
|
||||
} as React.CSSProperties
|
||||
}
|
||||
toastOptions={{
|
||||
|
||||
Reference in New Issue
Block a user