Skip to content

Commit

Permalink
Remove the need to use !important to customise variants (#385)
Browse files Browse the repository at this point in the history
* Remove the need for people to use !important to customise variants

* Update CHANGELOG

* 1.0.9
  • Loading branch information
iamhosseindhv authored May 19, 2021
1 parent f1e1e76 commit 066cb52
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 19 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
Thanks to all contributers who improved notistack by opening an issue/PR.

### `[email protected]`
###### May 19, 2021
* **@SimonAmphora** Remove the need to use `!important` to customise variant styles [#215 (comment)](https://github.com/iamhosseindhv/notistack/issues/215#issuecomment-700060481)

<br />

### `[email protected]`
###### May 18, 2021
* **@angeshpc91** Fixes issues with centered snackbars on xs screen sizes [#380](https://github.com/iamhosseindhv/notistack/issues/380)
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "notistack",
"version": "1.0.8",
"version": "1.0.9",
"description": "Highly customizable notification snackbars (toasts) that can be stacked on top of each other",
"main": "dist/index.js",
"module": "dist/notistack.esm.js",
Expand Down
34 changes: 17 additions & 17 deletions src/SnackbarItem/SnackbarItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,33 @@ const styles = (theme: Theme) => {
const backgroundColor = emphasize(theme.palette.background.default, mode === 'light' ? 0.8 : 0.98);
return createStyles({
...allClasses.mui,
contentRoot: {
...theme.typography.body2,
backgroundColor,
color: theme.palette.getContrastText(backgroundColor),
alignItems: 'center',
padding: '6px 16px',
borderRadius: '4px',
boxShadow: '0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)',
},
lessPadding: {
paddingLeft: 8 * 2.5,
},
variantSuccess: {
backgroundColor: '#43a047 !important', // green
color: '#fff !important',
backgroundColor: '#43a047', // green
color: '#fff',
},
variantError: {
backgroundColor: '#d32f2f !important', // dark red
color: '#fff !important',
backgroundColor: '#d32f2f', // dark red
color: '#fff',
},
variantInfo: {
backgroundColor: '#2196f3 !important', // nice blue
color: '#fff !important',
backgroundColor: '#2196f3', // nice blue
color: '#fff',
},
variantWarning: {
backgroundColor: '#ff9800 !important', // amber
color: '#fff !important',
},
contentRoot: {
...theme.typography.body2,
backgroundColor,
color: theme.palette.getContrastText(backgroundColor),
alignItems: 'center',
padding: '6px 16px',
borderRadius: '4px',
boxShadow: '0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)',
backgroundColor: '#ff9800', // amber
color: '#fff',
},
message: {
display: 'flex',
Expand Down

0 comments on commit 066cb52

Please sign in to comment.