design: make toasts look 8.26x better
This commit is contained in:
4 files changed
+72
-28
No files matched your search
@@ -10,8 +10,6 @@
|
||||
InformationCircle,
|
||||
XMark,
|
||||
} from 'svelte-hero-icons/dist'
|
||||
import { expoOut } from 'svelte/easing'
|
||||
import { fly } from 'svelte/transition'
|
||||
import { type Toast, toastColors, toasts } from './toasts'
|
||||
|
||||
interface Props {
|
||||
@@ -24,16 +22,10 @@
|
||||
<div
|
||||
class={[
|
||||
toastColors[toast.type],
|
||||
'relative rounded-xl overflow-hidden flex flex-row items-center gap-2 px-3 py-3 border border-slate-200 dark:border-zinc-800',
|
||||
'relative rounded-2xl overflow-hidden flex flex-row items-center gap-1 px-2 py-2 backdrop-blur-xl',
|
||||
'bg-white dark:bg-zinc-925 shadow-lg',
|
||||
toast.long ? 'w-full max-w-lg' : 'w-80',
|
||||
]}
|
||||
transition:fly={{
|
||||
duration: 600,
|
||||
y: 8,
|
||||
opacity: 0,
|
||||
easing: expoOut,
|
||||
}}
|
||||
>
|
||||
{#if toast.loading}
|
||||
<div class="relative m-2 ml-4 shrink-0">
|
||||
|
||||
@@ -3,10 +3,10 @@ import { writable } from 'svelte/store'
|
||||
type ToastType = keyof typeof toastColors
|
||||
|
||||
export const toastColors = {
|
||||
error: 'text-red-600 dark:text-red-400',
|
||||
warning: 'text-yellow-600 dark:text-yellow-400',
|
||||
success: 'text-green-600 dark:text-green-400',
|
||||
info: '',
|
||||
error: 'container-error',
|
||||
warning: 'container-warning',
|
||||
success: 'container-success',
|
||||
info: 'container-info',
|
||||
}
|
||||
|
||||
export interface Toast {
|
||||
|
||||
Reference in new issue
Block a user