More ways to make toasts look like your product. No breaking changes.
Everything here is optional. If you change nothing, your toasts look and move exactly as before. The demos below run the shipped library.
npm i @yusufceng1z/ding@latest
Filled toasts New
Each toast now has three variables you can set per status: --fill for the surface, --on for the text, buttons and focus ring, and --c for the icon. Set them and the whole toast takes the status color. The action button, the second button, the progress bar and the close button follow along.
toast.configure takes two new options. springs retunes the three motions, enter, morph and stack, with a stiffness and a damping each. Leave one out to keep its default. icons replaces a status icon with your own paths on a 24×24 grid. Both apply to toasts shown afterwards.
The first path of an icon is its outer ring, which loading toasts draw as a turning arc. Keep three paths for warning and info, because their animations use the second and third.
Each button changes the setting, then shows a toast.
More CSS variables, and a new playground
The docs now list the variables that were already there: --tst-size, --tst-pad, --tst-shadow and --tst-enter-scale, plus the font, which you set on .tst-viewport. The playground was rebuilt around them. Pick a ready-made style, change the radius, size, colors, motion or icon on a real toast, then copy the CSS and config.
--tst-radius: 0 was treated as missing, so toasts stayed rounded at 24px. A radius of 0 now gives square corners. A radius you change while a toast is open also shows up on its next move, where it used to wait for the next toast.