-
-
Notifications
You must be signed in to change notification settings - Fork 298
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
Unable to provide CSS class on < Snackbar > directly #11
Comments
@BornaP Please edit this sandbox and apply what you're trying to achieve, then share the example url here. |
I'm trying to apply CSS class directly to I believe it can easily be solved with passing What do you think? If it makes sense, I can make PR for it. |
@BornaP I believe you can do so using const styles = {
snack: {
position: 'absolute',
height: 50,
bottom: 70,
left: 10,
backgroundColor: 'red',
},
};
const App = ({ classes }) => (
<SnackbarProvider
maxSnack={3}
classes={{
root: classes.snack,
}}
>
<MessageButtons />
</SnackbarProvider>
);
export default withStyles(styles)(App) link to SANDBOX EXAMPLE: https://codesandbox.io/s/j9k0063q5 |
That's the issue. Classes root set's it to SnackbarItem, not Snackbar component. I need to position Snackbar's |
Closed due to fix and/or inactivity. feel free to reopen. |
The bottom css in root is useless as it is overwritten with inline style. Is there any way to set the bottom or top css without being overwritten? I need to set the top css parameter to a specific value... |
You can try to use marginBottom or marginTop, which might work if you only have one notification. |
I would like to reopen this issue. On devices with bottom navigation, I can´t seem to place the notification container above the bottom navigation, so I can use multiple notifications. |
@matsgm and others, this is actually possible but undocumented:
|
Documentation can be found here: https://iamhosseindhv.com/notistack/api#classes |
@iamhosseindhv apologies, I missed containerRoot there. I guess this issue can be closed then? |
Yeah maybe title of the issue is not applicable anymore. The reason I have this issue open is that I'd like us all to have a way to dynamically change the position of snackbar container. Say you're developing a web app with bottom navigation. Currently you can change bottom position of snackbar container. but not all of the pages have bottom navigation. You should have a way of toggling between different mode/positions as user navigates between different pages. |
As per comment above |
Is there a way to override CSS on element directly?
The text was updated successfully, but these errors were encountered: