I am trying to change the color of to lightgray I used the html code as below:
<ion-card *ngFor="let details of checkOutAddr" round inset class="ion-card">
<ion-item>
<ion-row>
<ion-col><ion-icon ios="ios-create" md="md-create" item-right class="color1"></ion-icon>
<b>{{details.name}}</b>
</ion-col>
</ion-row>
<ion-row>
{{details.stage}}
</ion-row>
<ion-row>
{{details.main}}
</ion-row>
<ion-row>
{{details.state}}
</ion-row>
<ion-row>
<ion-col>
<ion-icon ios="ios-call" md="md-call" item-left></ion-icon>
{{details.phone}}
</ion-col>
</ion-row>
<ion-row>
<ion-col>
<ion-icon ios="ios-mail" md="md-mail" item-left></ion-icon>
{{details.mail}}
</ion-col>
</ion-row>
</ion-item>
</ion-card
I used the scss code as below:
.ion-card {
background-color: slategray !important;
}
How do i get the look and feel as below img:
Adding the following code to my app global stylings / theme: --ion-background-color:#eee; changes the color of ion-cards as well.
For some reason I solved it this way: First of all I added --ion-background-color:#ffffff; in the variables. scss file inside theme folder. After that the background was successful set.
The text component is a simple component that can be used to style the text color of any element. The ion-text element should wrap the element in order to change the text color of that element.
In order to do it in a more Ionic2 way you need to replace the value of these sass variables:
$card-ios-background-color
$card-md-background-color
$card-wp-background-color
So, you just need to add the new value in app/theme/app.variables.scss
, like this:
$card-ios-background-color: slategray;
$card-md-background-color: slategray;
$card-wp-background-color: slategray;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With