New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
console error when styling variantDefault #95
Comments
@intergalactic-overlords notistack You can see a full list of available keys here: https://material-ui.com/api/snackbar/#css |
But variantSuccess, variantError, variantInfo, variantWarning are not mentioned as well on that material-ui page and it is possible to use them. |
Ok, I understand now. When adding |
The ability to have different If a snackbar is not of variant success, info, error or warning, then it's just a normal snackbar. In that case you can use the low level api provided by material-ui. (https://material-ui.com/api/snackbar/#css) this line makes You should probably use the classes={{
root: classes.yourStylings,
}} |
have you tried passing classes through ContentProps={
classes={{ root: classes.myRedBackgroundColor }}
} |
This works. The only problem is that rule overrides the other variant styles. I didn't find a way to set a red background as default and a black for the 'error' one. |
how about this one? @dalborgo ContentProps={{
classes: {
root: classes.myRedBackgroundColor,
variantError: classes.yourBlackgroundColor,
}
}} |
When styling variantDefault by using material ui classes, I get the following error in the console:
Warning: Material-UI: the key `variantDefault` provided to the classes property is not implemented in SnackbarItem. You can only override one of the following: root,anchorOriginTopCenter,anchorOriginBottomCenter,anchorOriginTopRight,anchorOriginBottomRight,anchorOriginTopLeft,anchorOriginBottomLeft,base,lessPadding,variantSuccess,variantError,variantInfo,variantWarning,message.
The snackbar receives styling, so it works, but somehow the error is thrown.
Expected Behavior
styled default snackbar and no errors
Current Behavior
styled default snackbar and errors
Steps to Reproduce
Link: https://codesandbox.io/s/2014qr4vvn
Context
I'm trying to style the default snackbar. And I don't want errors in my console.
Your Environment
The text was updated successfully, but these errors were encountered: