/* The fade delay comes from the component as `--dsh-toast-hold`, so one value drives both the unmount timer and this animation; the fallback matches the component's own default. The fade DURATION still has to agree with FADE_MS in Toast.tsx, which no owner varies. */ .toast { position: fixed; top: 40px; left: 50%; /* Above the 1000 the image lightbox backdrop uses: a failure reported while a preview is open must stay readable. */ z-index: 1100; /* Announcements never intercept clicks. */ pointer-events: none; display: flex; align-items: center; gap: 10px; /* Fixed boxes with `left` set shrink-to-fit against the space RIGHT of `left` (the -50% translate happens after sizing), so an anchored banner near the window edge would wrap early. max-content sizes the box from its text alone, capped by the max-width below. */ width: max-content; max-width: min(640px, calc(100vw - 48px)); padding: 12px 16px; border-radius: var(--dsw-radius-lg); /* The design platform's toast surface is dark in BOTH themes (bluish-800 light / bluish-750 dark), so the label and the action text below stay fixed instead of flipping with the theme. */ background: var(--dsw-alias-toast-bg); color: var(--dsw-alias-toast-label); font-size: 14px; line-height: 22px; box-shadow: var(--dsw-shadow-lv3); transform: translateX(-50%); animation: dsh-toast-in 160ms ease-out, dsh-toast-fade 1000ms ease var(--dsh-toast-hold, 3000ms) forwards; } .icon { display: grid; place-items: center; flex: none; color: var(--dsw-alias-state-warn-label); } .icon.success { color: var(--dsw-alias-state-success-primary); } .text { min-width: 0; } .action { display: inline; padding: 0; border: 0; background: none; /* Reads as the action against the always-dark toast surface without an underline. */ color: var(--dsw-alias-toast-action); font: inherit; cursor: pointer; /* Breathing room where the action text meets the surrounding copy. */ margin-inline: 3px; /* The banner surface stays click-through (`pointer-events: none` above); only its action text takes the pointer. */ pointer-events: auto; } @media (hover: hover) { .action:hover { opacity: 0.8; } } @keyframes dsh-toast-in { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; transform: translate(-50%, 0); } } @keyframes dsh-toast-fade { to { opacity: 0; visibility: hidden; } } /* Reduced motion drops the slide-in; the delayed fade (an opacity change, not movement) still ends the banner before the timed unmount. */ @media (prefers-reduced-motion: reduce) { .toast { animation: dsh-toast-fade 1000ms ease var(--dsh-toast-hold, 3000ms) forwards; } }