Override snackbar :host styles
See original GitHub issueBug, feature request, or proposal:
Bug
What is the expected behavior?
I add extraClasses: ['errorSnackBar']
to my snackbar config in order to override the styles of the container. I should be able to change the background color.
The only way I can get around it is by adding !important
to everything and thats no bueno.
What is the current behavior?
My class is added properly but background color is overwritten by the :host
styles in the snack-bar-container
What are the steps to reproduce?
Try to change the background color.
PLNKR Link. The background: blue
is overridden.
What is the use-case or motivation for changing an existing behavior?
Which versions of Angular, Material, OS, browsers are affected?
Is there anything else we should know?
Issue Analytics
- State:
- Created 6 years ago
- Comments:6
Top Results From Across the Web
Override snackbar :host styles · Issue #4201 - GitHub
I add extraClasses: ['errorSnackBar'] to my snackbar config in order to override the styles of the container. I should be able to change...
Read more >CSS : Angular Material Overriding Default Style of SnackBar ...
CSS : Angular Material Overriding Default Style of SnackBar Component [ Beautify Your Computer : https://www.hows.tech/p/recommended.html ] ...
Read more >Configuring Snackbar in Jetpack Compose when using ...
This is how the Snackbar would show once everything is setup and working, above the bottom navigation bar. scaffoldState. snackbarHostState.
Read more >Angular Material Overriding Default Style of SnackBar ...
Save this question. Show activity on this post. I am attempting to override the default max-width of the snackbar component in Angular Material....
Read more >SnackbarHostState - Android Developers
decouple snackbar host state from scaffold state for demo purposes ... To change the Snackbar appearance, change it in 'snackbarHost' on the Scaffold...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@theKush I just had to be more specific in my styling. I was trying to add error and success type classes. This is what I ended up doing:
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.