Closed madaz closed 4 years ago
Thanks for reporting this. @madaz
This has been fixed and will be published in the next version release.
Thanks for reporting this. @madaz
This has been fixed and will be published in the next version release.
still not work in 0.9.7
The
<SnackbarItem/>
variant background-color is not been applied because theMuiPaper-root
class is overriding in my application.This is because of the jss styles
<style>
tag injection order where the MuiPaper styles are injected after the `As mentioned here https://stackoverflow.com/questions/49180192/how-to-specify-the-order-in-which-the-style-sheets-appear-in-the-document
More info https://cssinjs.org/jss-api/?v=v10.0.0#attach-style-sheets-in-a-specific-order
material-ui uses a default negative incremented index counter. https://github.com/mui-org/material-ui/blob/master/packages/material-ui-styles/src/makeStyles/indexCounter.js which is defaults to if no index is passed in https://github.com/mui-org/material-ui/blob/master/packages/material-ui-styles/src/makeStyles/makeStyles.js#L197
Expected Behavior
<SnackbarItem/>
variants should style with background-colorCurrent Behavior
Cascading style rules MuiPaper overriding
Style tags incorrect order
Proposal
Enforce notistack styles to come after Mui style tags...or at least provide a way to pass in options in the SnackbarProvider.
As a test, I got it working locally by adding
{ index: 1 }
to thewithStyles
node_modules\notistack\build\SnackbarItem\SnackbarItem.js
(or
/src/SnackbarItem/SnackbarItem.js
)snackbaritem styles last
Your Environment