Reputation: 1
I'm trying to learn Ionic with Vue.js. I want to do something simple: just change the background color, but it doesn't work. I don't found good documentation explaining how can i do that
<template>
<ion-page>
<ion-header>
<ion-toolbar class="header">
<img class="icon" src="/icon.svg"/>
<ion-title class="title">Name</ion-title>
</ion-toolbar>
</ion-header>
<ion-content :fullscreen="true">
<ion-header collapse="condense">
<ion-toolbar>
<ion-title size="large">Tab 1</ion-title>
</ion-toolbar>
</ion-header>
<ExploreContainer name="Tab 1 page" />
</ion-content>
</ion-page>
</template>
<script setup lang="ts">
</script>
<style>
.icon {
width: 4rem;
height: auto;
margin-right: 8px;
}
ion-header {
background-color: red;
}
</style>
thanks
Upvotes: 0
Views: 55
Reputation: 177
You can try below steps to change background color of header.
NOTE:
// for mobile
.header-collapse-condense ion-toolbar{
--background : red
}
// for web
ion-toolbar {
--background: red;
}
Upvotes: -1