Notistack: Variant style are using !important

Created on 19 Nov 2020  路  1Comment  路  Source: iamhosseindhv/notistack


I'm customizing any type of variant: success, error, info.

Previous code was:
variantSuccess: {
backgroundColor: '#43a047',
color: '#fff'
},
variantError: {
backgroundColor: '#d32f2f',
color: '#fff'
},
variantInfo: {
backgroundColor: '#2196f3',
color: '#fff'
},
variantWarning: {
backgroundColor: '#ff9800',
color: '#fff'
},

Now it is:

variantSuccess: {
backgroundColor: '#43a047 !important', // green
color: '#fff !important',
},
variantError: {
backgroundColor: '#d32f2f !important', // dark red
color: '#fff !important',
},
variantInfo: {
backgroundColor: '#2196f3 !important', // nice blue
color: '#fff !important',
},
variantWarning: {
backgroundColor: '#ff9800 !important', // amber
color: '#fff !important',
},

Expected Behavior

There should not be any !important inside the variant styles as I want to customize the style of my success, error, snackbars

Current Behavior

Now the current version is adding !important on each class and in order to customize them:
using other !important is not feasible

Steps to Reproduce

Upgrade to v1.0.1 version

| Tech | Version |
|--------------|---------|
| Notistack | v1.0.1 |

Thanks,
Glauco

Most helpful comment

Yes @glaucopater is right, it only works using important
image

Regards,
Xabier

>All comments

Yes @glaucopater is right, it only works using important
image

Regards,
Xabier

Was this page helpful?
0 / 5 - 0 ratings

Related issues

VincentLanglet picture VincentLanglet  路  3Comments

FabianoLothor picture FabianoLothor  路  4Comments

iamhosseindhv picture iamhosseindhv  路  7Comments

Mel0nHead picture Mel0nHead  路  5Comments

kubalobo picture kubalobo  路  5Comments