Toast.module.css 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /* Transient top-center banner (DeepSeek Chat toast look): contrast fill,
  2. inverted label, slide-in, then hold-and-fade. The fade delay/duration MUST
  3. agree with HOLD_MS/FADE_MS in Toast.tsx: the component unmounts at their
  4. sum, so a mismatched sheet either cuts the fade or leaves an invisible
  5. banner blocking nothing. */
  6. .toast {
  7. position: fixed;
  8. top: 120px;
  9. left: 50%;
  10. /* Above the 1000 the image lightbox backdrop uses: a failure reported while
  11. a preview is open must stay readable. */
  12. z-index: 1100;
  13. /* Purely an announcement: it must never intercept clicks — in particular
  14. after the CSS fade finished while a throttled background-tab timer has
  15. not yet unmounted the still-hit-testable fixed element. */
  16. pointer-events: none;
  17. display: flex;
  18. align-items: center;
  19. gap: 10px;
  20. max-width: min(560px, calc(100vw - 48px));
  21. padding: 12px 16px;
  22. border-radius: 14px;
  23. background: var(--dsw-alias-button-contrast-fill);
  24. color: var(--dsw-alias-label-primary-inverted);
  25. font-size: 14px;
  26. line-height: 22px;
  27. box-shadow: var(--dsw-shadow-lv3);
  28. transform: translateX(-50%);
  29. animation:
  30. dsh-toast-in 160ms ease-out,
  31. dsh-toast-fade 1000ms ease 3000ms forwards;
  32. }
  33. .icon {
  34. display: grid;
  35. place-items: center;
  36. flex: none;
  37. color: var(--dsw-alias-state-warn-label);
  38. }
  39. .text {
  40. min-width: 0;
  41. }
  42. @keyframes dsh-toast-in {
  43. from {
  44. opacity: 0;
  45. transform: translate(-50%, -6px);
  46. }
  47. to {
  48. opacity: 1;
  49. transform: translate(-50%, 0);
  50. }
  51. }
  52. @keyframes dsh-toast-fade {
  53. to {
  54. opacity: 0;
  55. }
  56. }
  57. /* Reduced motion drops the slide-in; the delayed fade (an opacity change,
  58. not movement) still ends the banner before the timed unmount. */
  59. @media (prefers-reduced-motion: reduce) {
  60. .toast {
  61. animation: dsh-toast-fade 1000ms ease 3000ms forwards;
  62. }
  63. }