question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to style element properties for <ion-tab>, tab icons

See original GitHub issue

Bug Report

Ionic Info Run ionic info from a terminal/cmd prompt and paste the output below.

Ionic:

   ionic (Ionic CLI)          : 4.0.1
   Ionic Framework            : @ionic/angular 4.0.0-beta.2
   @angular-devkit/core       : 0.7.0-beta.2
   @angular-devkit/schematics : 0.7.0-beta.2
   @angular/cli               : 6.0.3
   @ionic/ng-toolkit          : 1.0.0
   @ionic/schematics-angular  : 1.0.0

System:

   NodeJS : v9.4.0 (/usr/local/Cellar/node/9.4.0/bin/node)
   npm    : 6.3.0
   OS     : macOS High Sierra

Describe the Bug Unable to edit style properties of tab-icon-button. Tab bar icons aren’t respecting the CSS as it should. Unable to modify the icon size and change change color when the tab-button active.

I’m able to edit element properties in the browser console, I would expect just to get the class of .tab-button-icon and set the same properties in the global.scss but it doesn’t apply changes.

.tab-button-icon{
    font-size:10px;
}
<ion-tab href="/app/(home:home)" icon="happy" label="Browse">
        <ion-router-outlet name="home"></ion-router-outlet>
    </ion-tab> 

Steps to Reproduce Steps to reproduce the behavior:

  1. Launch the App

Related Code

    <ion-tab href="/app/(home:home)" icon="happy" label="Browse">
        <ion-router-outlet name="home"></ion-router-outlet>
    </ion-tab>
    <ion-tab href="/app/(meal-plan:meal-plan)" icon="egg" label="Meal Plan">
        <ion-router-outlet name="meal-plan"></ion-router-outlet>
    </ion-tab>
    <ion-tab href="/app/(shopping:shopping)" icon="list" label="Shopping List">
        <ion-router-outlet name="shopping"></ion-router-outlet>
    </ion-tab>
    <ion-tab href="/app/(account:account)" icon="person" label="Account">
        <ion-router-outlet name="account"></ion-router-outlet>
    </ion-tab>
</ion-tabs>

Expected Behavior I expect style changes to the tab icon classes or the tab itself to apply.

Additional Context iOS:

I’m able to adjust size and style the tab bar as desired using the browser console. Trying to make the same changes in the global scss file doesn’t work.

screen shot 2018-08-21 at 2 49 06 pm

screen shot 2018-08-21 at 2 49 33 pm

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
brandyscarneycommented, Oct 30, 2018

@NathanNovak Sorry, my comment was worded weird! 4.0.0-beta.14 hasn’t been released yet. We’re planning to release it this week.

0reactions
ionitron-bot[bot]commented, Nov 29, 2018

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to style element properties for <ion-tab>, tab icons
Run ionic info from a terminal/cmd prompt and paste the output below. Ionic: ionic (Ionic CLI) : 4.0.1 Ionic Framework : @ionic/angular 4.0....
Read more >
Ion-tabs Styling - unable to find element
Ion-tabs Styling - unable to find element · StackBlitz Example · Common Tab Template: · Modified Styles for tab:
Read more >
Change appearance of only 1 tab on the Ionic - Stack Overflow
Do you know how to create a bigger and rounded top tab like so on the 3rd one? i.e. middle one. I have...
Read more >
Customize your Ionic Framework app with CSS Shadow Parts!
The placeholder text and icon elements are inside of the #shadow-root , which means the following CSS will NOT work to style the...
Read more >
Styling ion-tabs in Ionic 5 - DEV Community ‍ ‍
The real magic happens in the component styles file. First, I targeted the ion-tab-bar element. Since I only needed it to move it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found