Adding a class doesn't override backgroundColor
See original GitHub issueIf I do NOT set a backgroundColor option when calling Toastify, but add a className
that maps for instance to a Bootstrap alert class, the Toast’s default backgroundColor still takes precedence over the class’ background color.
i.e.
Toastify({
text: "A simple warning alert—check it out!",
duration: 3000,
close: true,
gravity: "bottom",
positionLeft: false,
className:"alert alert-warning>"
}).showToast();
Should yield the following:
Instead I get:
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Changing class to element doesn't change background color
It's the order of your CSS. You add .colorBrightRed and .colorRedNoHov to the element when it flashes, and for the red colors, ....
Read more >Change Background Color Using JavaScript
Learn how to change the background color of an HTML Element dynamically in JavaScript in THREE different ways.
Read more >background-color - CSS: Cascading Style Sheets | MDN
The background-color CSS property sets the background color of an element.
Read more >HTML Background Color Tutorial – How to Change a Div ...
Let's change the background color of the divs by adding styles to the classes. You can follow along by trying the examples in...
Read more >How to Change Text and Background Color in CSS
You might be wondering what happens if you don't set the color property in your CSS. That's a good question. The default text...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
FYI I ended up doing the following to achieve what I wanted (thankfully I was already packing SCSS):
I added one-line CSS to solve that