Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit e80d0d2

Browse files
olegoodekara
authored andcommitted
fix(tabs): icon color isn't correct when the tab item is not active (#9620)
Closes #9536
1 parent 25dd787 commit e80d0d2

File tree

5 files changed

+51
-15
lines changed

5 files changed

+51
-15
lines changed

src/components/tabs/demoStaticTabs/index.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,20 @@
2222
data.selectedIndex = 2;
2323
</md-tab-body>
2424
</md-tab>
25+
<md-tab id="tab4">
26+
<md-tab-label><md-icon md-svg-icon="communication:phone"></md-icon></md-tab-label>
27+
<md-tab-body>
28+
View for Item #4 <br/>
29+
data.selectedIndex = 3;
30+
</md-tab-body>
31+
</md-tab>
32+
<md-tab id="tab5">
33+
<md-tab-label><md-icon md-svg-icon="favorite"></md-icon></md-tab-label>
34+
<md-tab-body>
35+
View for Item #5 <br/>
36+
data.selectedIndex = 4;
37+
</md-tab-body>
38+
</md-tab>
2539
</md-tabs>
2640
</md-content>
2741

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<p>The Static Tabs demo how to disable and bottom-align tabs:</p>
1+
<p>The Static Tabs demo shows how to disable and bottom-align tabs:</p>

src/components/tabs/demoStaticTabs/script.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22
'use strict';
33

44
angular
5-
.module('tabsDemoStaticTabs', ['ngMaterial'] )
5+
.module('tabsDemoIconTabs', ['ngMaterial'] )
6+
.config(function($mdIconProvider) {
7+
$mdIconProvider
8+
.iconSet('communication', 'img/icons/sets/communication-icons.svg')
9+
.icon('favorite', 'img/icons/favorite.svg');
10+
})
611
.controller('AppCtrl', AppCtrl);
712

813
function AppCtrl ( $scope ) {

src/components/tabs/demoStaticTabs/style.scss

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
1-
md-tab-content {
2-
padding: 25px;
3-
&:nth-child(1) {
4-
background-color: #42A5F5;
5-
}
6-
&:nth-child(2) {
7-
background-color: #689F38;
8-
}
9-
&:nth-child(3) {
10-
background-color: #26C6DA;
1+
md-content {
2+
md-tabs {
3+
border: 1px solid #e1e1e1;
4+
md-tab-content {
5+
padding: 25px;
6+
&:nth-child(1) {
7+
background-color: #cfd8dc;
8+
}
9+
&:nth-child(2) {
10+
background-color: #ffb74d;
11+
}
12+
&:nth-child(3) {
13+
background-color: #ffd54f;
14+
}
15+
&:nth-child(4) {
16+
background-color: #aed581;
17+
}
18+
&:nth-child(5) {
19+
background-color: #00897b;
20+
}
21+
}
1122
}
1223
}
1324
.after-tabs-area {

src/components/tabs/tabs-theme.scss

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
> md-tabs-canvas {
55
> md-pagination-wrapper {
66
> md-tab-item:not([disabled]) {
7-
color: '{{primary-100}}';
7+
&, md-icon {
8+
color: '{{primary-100}}';
9+
}
810
&.md-active, &.md-focused {
911
&, md-icon {
1012
color: '{{primary-contrast}}';
@@ -24,7 +26,9 @@
2426
> md-tabs-canvas {
2527
> md-pagination-wrapper {
2628
> md-tab-item:not([disabled]) {
27-
color: '{{warn-100}}';
29+
&, md-icon {
30+
color: '{{warn-100}}';
31+
}
2832
&.md-active, &.md-focused {
2933
&, md-icon {
3034
color: '{{warn-contrast}}';
@@ -44,7 +48,9 @@
4448
> md-tabs-canvas {
4549
> md-pagination-wrapper {
4650
> md-tab-item:not([disabled]) {
47-
color: '{{accent-A100}}';
51+
&, md-icon {
52+
color: '{{accent-A100}}';
53+
}
4854
&.md-active, &.md-focused {
4955
&, md-icon {
5056
color: '{{accent-contrast}}';

0 commit comments

Comments
 (0)