Ion-toolbar background-image Ionic 4


#1

Using .toolbar-background no longer seems to work in Ionic 4.

How does the background image get set now?

.toolbar-background {
    background-image: url('assets/images/myimage.jpg');
}

#2

yep .toolbar-background doesn’t exist anymore I think in Ionic v4

because of shadow-root a lot of styling may change if you were, like me, relied on style classes

you will probably have to set a css4 variables to solve this, like

 ion-toolbar {
    --background: url('assets/images/myimage.jpg') no-repeat fixed center; 
 }

something like that


Ionic v4 ion-toolbar color not working
#3

Thanks - that worked!


#4

coolio :slight_smile: