solid-toast icon indicating copy to clipboard operation
solid-toast copied to clipboard

Customize toast

Open jacksonsophat opened this issue 2 years ago • 3 comments

This isn't an issue, just a question.

How can I customize a toast globally? For example, change the background color that can work across the app?

Thank you!

jacksonsophat avatar Mar 23 '23 16:03 jacksonsophat

Hello! https://github.com/ardeora/solid-toast#available-options-1 Does this help? You can set background color of the toast globally on the <Toaster /> component. Or do you mean when using toast.custom()?

ardeora avatar Mar 23 '23 16:03 ardeora

I don't think that would work the way I want it. I want to have border red for error and green for success globally. Hope I make sense.

jacksonsophat avatar Mar 23 '23 20:03 jacksonsophat

as i noticed by inspecting the the documentation site i realized that you can get your desirable result with global CSS customization here is a example bellow.

i noticed that the div of toast uses the sldt-active class so we can selected toast with following code.

/** just a example **/
.sldt-active > div {
  border-color: red;
  border-width: 2px;
}

gxanshu avatar Aug 04 '23 17:08 gxanshu