Files
deepseek-harness/packages/client/ui-primitives/src/Toast.module.css
T
Xinyu Yangand神河一号 - 烈焰流光 efdf8e5b6d feat(shortcuts): add configurable Web and desktop shortcuts
Add the keyboard registry, device-local preferences, and searchable shortcut editor. Support Web routing and native Desktop single-key and two-key bindings.

Co-authored-by: 神河一号 - 烈焰流光 <[email protected]>
2026-09-21 23:57:28 +08:00

102 lines
2.7 KiB
CSS

/* 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: 14px;
/* 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;
/* deepseek-400, brightened at the designer's request, reads as the action
against the always-dark toast surface without an underline. */
color: var(--dsw-static-deepseek-400);
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;
}
.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;
}
}