Answers for "change background color in ionic ion-item"

0

ion-content background color

ion-content{

    --ion-background-color:#111D12;
}
Posted by: Guest on November-03-2020
2

ionic header background color

It seems like the ion-header acts more as a container for an inner ionic component (like an ion-toolbar). I looked over the Ionic v4 ion-toolbar documentation. This component has many custom css custom properties, including --background, that can be customized. This may be what you're looking for.

Assuming you used the CLI to create a 'login' page component, you can add a new css class definition to the login.scss file:

.new-background-color{
    --background: #54d61c;
}
And then refer to it in your login.page.html file:

<ion-header>
  <ion-toolbar class="new-background-color">
        <ion-title>Login</ion-title>
  </ion-toolbar>
</ion-header>
Posted by: Guest on June-20-2020

Code answers related to "change background color in ionic ion-item"

Browse Popular Code Answers by Language