apvarun / toastify-js

Pure JavaScript library for better notification messages
https://apvarun.github.io/toastify-js/
MIT License
2.09k stars 230 forks source link

custom styles like background-color and color not getting applied through className attribute #107

Open Harshsngh07 opened 2 years ago

Harshsngh07 commented 2 years ago

In Index.js

 Toastify({
    text: "This is a toast",
    duration: 3000,
    gravity: topbottomValue,
    position: leftrightValue,
    className: "info",
  }).showToast();

In index.css

.info{
background-color: red;
}
Harshsngh07 commented 2 years ago

Tried this className and different classNames but looks like the color and background color is not changing

LautiLosio commented 1 year ago

I'm having the same issue, ended up styling through the style parameter, not ideal but works...

LWCoder commented 1 year ago

I had the same issue, but it was because the default toastify.css was setting the background color. After removing those lines I can now use className to style the background.