Skip to content

Commit 5898f24

Browse files
authored
fix(tabs): replace igx-icon with igc-icon in WC demo + fix theme parameters (scoped) (#16415)
1 parent 8bb6a80 commit 5898f24

File tree

9 files changed

+31
-17
lines changed

9 files changed

+31
-17
lines changed

projects/igniteui-angular/src/lib/tabs/tabs/header/themes/_base.scss

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ $theme-variant: map.get($theme, '_meta', 'theme-variant');
4545
}
4646

4747
&:focus {
48-
background: var-get($theme, 'item-active-background');
48+
background: var-get($theme, 'item-hover-background');
4949
color: var-get($theme, 'item-hover-color');
5050
border-bottom-color: transparent;
5151
}
@@ -71,14 +71,15 @@ $theme-variant: map.get($theme, '_meta', 'theme-variant');
7171
@include m(selected) {
7272
outline: 0;
7373
color: var-get($theme, 'item-active-color');
74+
background: var-get($theme, 'item-active-background');
7475

7576
&:hover,
7677
&:focus {
77-
background: var-get($theme, 'item-active-background');
78-
color: if($variant == 'fluent', var-get($theme, 'item-hover-color'), var-get($theme, 'item-active-color'));
78+
background: var-get($theme, 'item-active-hover-background');
79+
color: var-get($theme, 'item-active-hover-color');
7980

8081
igx-icon {
81-
color: var-get($theme, 'item-active-icon-color');
82+
color: var-get($theme, 'item-active-hover-icon-color');
8283
}
8384
}
8485

projects/igniteui-angular/src/lib/tabs/tabs/header/themes/shared/_bootstrap.scss

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ $_theme: $bootstrap;
88
@include themed-block(igx-tabs, bootstrap) {
99
%igx-tab-header--focus {
1010
border: none;
11-
box-shadow: inset 0 0 0 rem(2px) var-get($_theme, 'item-hover-color');
12-
border-radius: rem(4px);
11+
box-shadow: inset 0 0 0 rem(2px) var-get($_theme, 'item-active-hover-color');
12+
border-bottom-left-radius: rem(4px);
13+
border-bottom-right-radius: rem(4px);
1314
z-index: 1;
1415

1516
&::after {
@@ -32,7 +33,6 @@ $_theme: $bootstrap;
3233
}
3334

3435
@include m(selected) {
35-
background: var-get($_theme, 'item-active-background');
3636
position: relative;
3737
box-shadow: inset 0 0 0 rem(1px) var-get($_theme, 'border-color');
3838
z-index: 1;
@@ -62,6 +62,16 @@ $_theme: $bootstrap;
6262

6363
&:hover {
6464
box-shadow: inset 0 0 0 rem(1px) var-get($_theme, 'border-color');
65+
66+
&::before {
67+
background: linear-gradient(
68+
to right,
69+
var-get($_theme, 'border-color') 1px,
70+
var-get($_theme, 'item-active-hover-background') 1px,
71+
var-get($_theme, 'item-active-hover-background') calc(100% - 1px),
72+
var-get($_theme, 'border-color') calc(100% - 1px)
73+
);
74+
}
6575
}
6676
}
6777
}

projects/igniteui-angular/src/lib/tabs/tabs/header/themes/shared/_fluent.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ $_theme: $fluent;
1414
min-height: rem(44px);
1515
transition: all .3s $tabs-animation-function;
1616
border: rem(1px) solid var-get($_theme, 'border-color');
17+
border-radius: var-get($_theme, 'border-radius');
1718

1819
&:hover,
1920
&:focus {

projects/igniteui-angular/src/lib/tabs/tabs/header/themes/shared/_indigo.scss

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ $_theme: $indigo;
1717

1818
transition: all .3s $tabs-animation-function;
1919
border: rem(1px) solid var-get($_theme, 'border-color');
20+
border-radius: var-get($_theme, 'border-radius');
2021

2122
border-top: rem(1px) solid transparent;
2223
border-inline: none;
@@ -28,13 +29,6 @@ $_theme: $indigo;
2829
border-bottom: rem(1px) solid var-get($_theme, 'border-color');
2930
}
3031

31-
@include m(selected) {
32-
&:hover,
33-
&:focus-visible {
34-
background: var-get($_theme, 'item-hover-background');
35-
}
36-
}
37-
3832
@include e(inner) {
3933
> [igxtabheaderlabel] {
4034
@include type-style(subtitle-2) {

projects/igniteui-angular/src/lib/tabs/tabs/header/themes/shared/_material.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ $_theme: $material;
1212
min-height: rem(48px);
1313
transition: all .3s $tabs-animation-function;
1414
border: rem(1px) solid var-get($_theme, 'border-color');
15+
border-radius: var-get($_theme, 'border-radius');
1516

1617
&:hover,
1718
&:focus {

projects/igniteui-angular/src/lib/tabs/tabs/item/themes/_base.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ $theme: $material;
1616
align-items: center;
1717
overflow: hidden;
1818
flex: 0 0 auto;
19-
background: var-get($theme, 'item-background');
2019
z-index: 1;
2120

2221
@include e(content) {

projects/igniteui-angular/src/lib/tabs/tabs/item/themes/shared/_bootstrap.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ $_theme: $bootstrap;
88
@include themed-block(igx-tabs, bootstrap) {
99
@include b(igx-tabs-header) {
1010
position: relative;
11+
background: var-get($_theme, 'item-background');
1112

1213
&::after {
1314
content: '';

src/app/tabs-showcase/tabs-showcase.sample.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
@for (contact of contacts; track contact.id) {
3333
<igc-tab [selected]="contact.id === selectedTabId">
3434
@if(!properties.hideIcon) {
35-
<igx-icon slot="label">folder</igx-icon>
35+
<igc-icon name="folder" slot="label"></igc-icon>
3636
}
3737
@if(!properties.hideText) {
3838
<span slot="label">{{ contact.text }}</span>

src/app/tabs-showcase/tabs-showcase.sample.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,20 @@ import {
2020
defineComponents,
2121
IgcTabsComponent,
2222
IgcTabComponent,
23+
IgcIconComponent,
24+
registerIconFromText
2325
} from 'igniteui-webcomponents';
2426
import {
2527
PropertyChangeService,
2628
Properties,
2729
} from '../properties-panel/property-change.service';
2830

29-
defineComponents(IgcTabsComponent, IgcTabComponent);
31+
defineComponents(IgcTabsComponent, IgcTabComponent, IgcIconComponent);
32+
33+
registerIconFromText(
34+
'folder',
35+
'<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px"><path d="M160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h240l80 80h320q33 0 56.5 23.5T880-640v400q0 33-23.5 56.5T800-160H160Z"/></svg>'
36+
);
3037

3138
@Component({
3239
selector: 'app-tabs-showcase-sample',

0 commit comments

Comments
 (0)