css doesn't work in 3.1.0
yq314 opened this issue ยท 15 comments
yq314 commented
setting css with glamor doesn't work in 3.1.0, tried the example in document, no effect at all.
yq314 commented
Hi @fkhadra ,
I just ran a simple react app with this code:
import React from 'react';
import { ToastContainer, toast } from 'react-toastify';
import { css } from 'glamor';
class App extends React.Component {
closeAfter15 = () => toast("YOLO", { autoClose: 15000, className: css({
background: "black"
}) });
closeAfter7 = () => toast("7 Kingdoms", { autoClose: 15000 })
render(){
return (
<div>
<button onClick={this.closeAfter15}>Close after 15 seconds</button>
<button onClick={this.closeAfter7}>Close after 7 seconds</button>
<ToastContainer autoClose={8000} />
</div>
);
}
}
export default App;
click on the two buttons trigger the same toast with the default color, however the first one is supposed to be black.
fkhadra commented
@yq314 you have to use backgroundColor
instead of background
. My mistake, I'll fix the doc right now.
yq314 commented
yq314 commented
I'm using Chrome 62.0.3202.94 btw
fkhadra commented
yq314 commented
hmm, so weird, I cleared cache still no luck, tried in incognito mode also same...
yq314 commented
it doesn't work for me on both my PC and Mac...
fkhadra commented
I'll try with create-react-app to see what's going on
fkhadra commented
Css rules are not merged correctly.