toastify-js icon indicating copy to clipboard operation
toastify-js copied to clipboard

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

Open Harshsngh07 opened this issue 2 years ago • 3 comments

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 avatar Aug 02 '22 19:08 Harshsngh07

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

Harshsngh07 avatar Aug 02 '22 19:08 Harshsngh07

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

LautiLosio avatar Aug 17 '22 22:08 LautiLosio

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.

LWCoder avatar Oct 03 '22 18:10 LWCoder