Change NavBar color for all the pages in ionic
I am new in ionic and wants to learn it. my question is How to change nav bar color for all the pages in ionic 3.
I have been using following code
<ion-header>
<ion-navbar color="primary">
<button ion-button menuToggle>
<ion-icon name="menu"></ion-icon>
</button>
<ion-title>Hello Ionic</ion-title>
</ion-navbar>
</ion-header>
Is there any way to change nav bar color for all the pages instead of manually doing <ion-navbar color="primary">
ionic-framework ionic3 navbar
add a comment |
I am new in ionic and wants to learn it. my question is How to change nav bar color for all the pages in ionic 3.
I have been using following code
<ion-header>
<ion-navbar color="primary">
<button ion-button menuToggle>
<ion-icon name="menu"></ion-icon>
</button>
<ion-title>Hello Ionic</ion-title>
</ion-navbar>
</ion-header>
Is there any way to change nav bar color for all the pages instead of manually doing <ion-navbar color="primary">
ionic-framework ionic3 navbar
add a comment |
I am new in ionic and wants to learn it. my question is How to change nav bar color for all the pages in ionic 3.
I have been using following code
<ion-header>
<ion-navbar color="primary">
<button ion-button menuToggle>
<ion-icon name="menu"></ion-icon>
</button>
<ion-title>Hello Ionic</ion-title>
</ion-navbar>
</ion-header>
Is there any way to change nav bar color for all the pages instead of manually doing <ion-navbar color="primary">
ionic-framework ionic3 navbar
I am new in ionic and wants to learn it. my question is How to change nav bar color for all the pages in ionic 3.
I have been using following code
<ion-header>
<ion-navbar color="primary">
<button ion-button menuToggle>
<ion-icon name="menu"></ion-icon>
</button>
<ion-title>Hello Ionic</ion-title>
</ion-navbar>
</ion-header>
Is there any way to change nav bar color for all the pages instead of manually doing <ion-navbar color="primary">
ionic-framework ionic3 navbar
ionic-framework ionic3 navbar
asked Mar 12 '18 at 8:55
RiddhiRiddhi
805932
805932
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
Add following line to variables.scss file to change the color globally.
$toolbar-background: #3D9BDD;
Thank you. It worked.
– Riddhi
Mar 12 '18 at 9:32
how can we change the navbar text color?
– Junaid
Sep 8 '18 at 18:14
Where in the docs of Ionic did you find that property?
– user3748883
Dec 10 '18 at 9:25
add a comment |
This can achieve different way i will show you 2 way
First way
In variables.scss file $colors portion add customColor
$colors: (
primary: #488aff,
secondary: #32db64,
danger: #f53d3d,
light: #f4f4f4,
dark: #222,
customColor:(
base: #00953B,
contrast: #ffffff
)
);
Here base is background color and contrast is text-color
And change in .html file
<ion-header>
<ion-navbar color="customColor">
<button ion-button menuToggle>
<ion-icon name="menu"></ion-icon>
</button>
<ion-title>Hello Ionic</ion-title>
</ion-navbar>
</ion-header>
Second way
override default color toolbar color
$toolbar-background: #00953B;
add a comment |
If anyone is looking for a solution using dynamic themes, it is possible to change the text color using css like this in Ionic 3:
.header .toolbar-title {
color: #fff !important;
}
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f49231296%2fchange-navbar-color-for-all-the-pages-in-ionic%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
Add following line to variables.scss file to change the color globally.
$toolbar-background: #3D9BDD;
Thank you. It worked.
– Riddhi
Mar 12 '18 at 9:32
how can we change the navbar text color?
– Junaid
Sep 8 '18 at 18:14
Where in the docs of Ionic did you find that property?
– user3748883
Dec 10 '18 at 9:25
add a comment |
Add following line to variables.scss file to change the color globally.
$toolbar-background: #3D9BDD;
Thank you. It worked.
– Riddhi
Mar 12 '18 at 9:32
how can we change the navbar text color?
– Junaid
Sep 8 '18 at 18:14
Where in the docs of Ionic did you find that property?
– user3748883
Dec 10 '18 at 9:25
add a comment |
Add following line to variables.scss file to change the color globally.
$toolbar-background: #3D9BDD;
Add following line to variables.scss file to change the color globally.
$toolbar-background: #3D9BDD;
answered Mar 12 '18 at 9:24
Ajantha BandaraAjantha Bandara
641718
641718
Thank you. It worked.
– Riddhi
Mar 12 '18 at 9:32
how can we change the navbar text color?
– Junaid
Sep 8 '18 at 18:14
Where in the docs of Ionic did you find that property?
– user3748883
Dec 10 '18 at 9:25
add a comment |
Thank you. It worked.
– Riddhi
Mar 12 '18 at 9:32
how can we change the navbar text color?
– Junaid
Sep 8 '18 at 18:14
Where in the docs of Ionic did you find that property?
– user3748883
Dec 10 '18 at 9:25
Thank you. It worked.
– Riddhi
Mar 12 '18 at 9:32
Thank you. It worked.
– Riddhi
Mar 12 '18 at 9:32
how can we change the navbar text color?
– Junaid
Sep 8 '18 at 18:14
how can we change the navbar text color?
– Junaid
Sep 8 '18 at 18:14
Where in the docs of Ionic did you find that property?
– user3748883
Dec 10 '18 at 9:25
Where in the docs of Ionic did you find that property?
– user3748883
Dec 10 '18 at 9:25
add a comment |
This can achieve different way i will show you 2 way
First way
In variables.scss file $colors portion add customColor
$colors: (
primary: #488aff,
secondary: #32db64,
danger: #f53d3d,
light: #f4f4f4,
dark: #222,
customColor:(
base: #00953B,
contrast: #ffffff
)
);
Here base is background color and contrast is text-color
And change in .html file
<ion-header>
<ion-navbar color="customColor">
<button ion-button menuToggle>
<ion-icon name="menu"></ion-icon>
</button>
<ion-title>Hello Ionic</ion-title>
</ion-navbar>
</ion-header>
Second way
override default color toolbar color
$toolbar-background: #00953B;
add a comment |
This can achieve different way i will show you 2 way
First way
In variables.scss file $colors portion add customColor
$colors: (
primary: #488aff,
secondary: #32db64,
danger: #f53d3d,
light: #f4f4f4,
dark: #222,
customColor:(
base: #00953B,
contrast: #ffffff
)
);
Here base is background color and contrast is text-color
And change in .html file
<ion-header>
<ion-navbar color="customColor">
<button ion-button menuToggle>
<ion-icon name="menu"></ion-icon>
</button>
<ion-title>Hello Ionic</ion-title>
</ion-navbar>
</ion-header>
Second way
override default color toolbar color
$toolbar-background: #00953B;
add a comment |
This can achieve different way i will show you 2 way
First way
In variables.scss file $colors portion add customColor
$colors: (
primary: #488aff,
secondary: #32db64,
danger: #f53d3d,
light: #f4f4f4,
dark: #222,
customColor:(
base: #00953B,
contrast: #ffffff
)
);
Here base is background color and contrast is text-color
And change in .html file
<ion-header>
<ion-navbar color="customColor">
<button ion-button menuToggle>
<ion-icon name="menu"></ion-icon>
</button>
<ion-title>Hello Ionic</ion-title>
</ion-navbar>
</ion-header>
Second way
override default color toolbar color
$toolbar-background: #00953B;
This can achieve different way i will show you 2 way
First way
In variables.scss file $colors portion add customColor
$colors: (
primary: #488aff,
secondary: #32db64,
danger: #f53d3d,
light: #f4f4f4,
dark: #222,
customColor:(
base: #00953B,
contrast: #ffffff
)
);
Here base is background color and contrast is text-color
And change in .html file
<ion-header>
<ion-navbar color="customColor">
<button ion-button menuToggle>
<ion-icon name="menu"></ion-icon>
</button>
<ion-title>Hello Ionic</ion-title>
</ion-navbar>
</ion-header>
Second way
override default color toolbar color
$toolbar-background: #00953B;
answered Mar 12 '18 at 10:11
UtpaulUtpaul
1,0341417
1,0341417
add a comment |
add a comment |
If anyone is looking for a solution using dynamic themes, it is possible to change the text color using css like this in Ionic 3:
.header .toolbar-title {
color: #fff !important;
}
add a comment |
If anyone is looking for a solution using dynamic themes, it is possible to change the text color using css like this in Ionic 3:
.header .toolbar-title {
color: #fff !important;
}
add a comment |
If anyone is looking for a solution using dynamic themes, it is possible to change the text color using css like this in Ionic 3:
.header .toolbar-title {
color: #fff !important;
}
If anyone is looking for a solution using dynamic themes, it is possible to change the text color using css like this in Ionic 3:
.header .toolbar-title {
color: #fff !important;
}
edited Nov 25 '18 at 18:21
Stephen Rauch
28.7k153557
28.7k153557
answered Nov 25 '18 at 18:02
der.martyder.marty
11
11
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f49231296%2fchange-navbar-color-for-all-the-pages-in-ionic%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown