Skip to content
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

Remove the need to use !important to customise variants #385

Merged
merged 3 commits into from
May 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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