Notice: The Monaca & Onsen UI Community Forum is shutting down.
For Onsen UI bug reports, feature requests and questions, please use the Onsen UI GitHub issues page. For help with Monaca, please contact Monaca Support Team.
Thank you to all our community for your contributions to the forum. We look forward to hearing from you in the new communication channels.
How to change text color in ons-tab
-
Hello everyone,
Is there a way to change the text color in ons-tab? I use the ONSEN UI javascript core for my project.
Thanks in advance.
<ons-tab style=“color:#70AD47;” ></ons-tab>
-
Yes, you can create a custom theme for Onsen UI here:
https://onsen.io/theme-roller/?customizeScroll to the Tabbar section and change the colour as needed, then download and add to your project.
-
Thanks for your reply. Is that possible only to change one tab bar?
-
In that case you need to set a CSS
color
rule on the tab’s button (it has the classtabbar__button
).For example, you could create a class
custom-color
for the ons-tab and a CSS rule like:<ons-tab class="custom-color"></ons-tab>
.custom-color .tabbar__button { color: green; }
-
@emccorson said in How to change text color in ons-tab:
Yes, you can create a custom theme for Onsen UI here:
https://onsen.io/theme-roller/?customizeScroll to the Tabbar section and change the colour as needed, then download and add to your project.
this answer is really useful, thank you.