UI design disruptions can be such a pain. With Angular Material, I found that creating a separate css file, often called override-material-ui, and using identifier selectors to change styles instead of class names works very well. So for your code, this will be:
#override-toolbar { background: red; }
And the tag in html will look like this:
<md-toolbar id="override-toolbar"> </md-toolbar>
Obviously there will probably be more in the toolbar tag, but to redefine the styles, I believe this works best. This is good when you need to style multiple tags the same way. While inline effectively cancels everything out, annoying style changes may occur in the future.
But even if the ID selector doesn't crop it, and you donβt want to deal with custom themes, go to the inline style selector.
Hope this helps!
Mary
source share