Skip to content

Commit fbfd883

Browse files
authored
fix(tabs): replace igx-icon with igc-icon in WC demo + fix theme parameters (#16395)
1 parent f83cc06 commit fbfd883

File tree

3 files changed

+43
-31
lines changed

3 files changed

+43
-31
lines changed

projects/igniteui-angular/src/lib/core/styles/components/tabs/_tabs-theme.scss

Lines changed: 34 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -61,23 +61,23 @@
6161
%tabs-header {
6262
overflow: hidden;
6363
flex: 0 0 auto;
64-
background: var-get($theme, 'item-background');
6564
z-index: 1;
6665

67-
@if $bootstrap-theme {
68-
position: relative;
69-
70-
&::after {
71-
content: '';
72-
position: absolute;
73-
bottom: 0;
74-
inset-inline-start: 0;
75-
width: 100%;
76-
height: rem(1px);
77-
background: var-get($theme, 'border-color');
78-
z-index: 0;
79-
}
80-
}
66+
@if $bootstrap-theme {
67+
position: relative;
68+
background: var-get($theme, 'item-background');
69+
70+
&::after {
71+
content: '';
72+
position: absolute;
73+
bottom: 0;
74+
inset-inline-start: 0;
75+
width: 100%;
76+
height: rem(1px);
77+
background: var-get($theme, 'border-color');
78+
z-index: 0;
79+
}
80+
}
8181
}
8282

8383
%tabs-header-content {
@@ -204,6 +204,7 @@
204204
@if $not-bootstrap-theme {
205205
transition: all .3s $tabs-animation-function;
206206
border: rem(1px) solid var-get($theme, 'border-color');
207+
border-radius: var-get($theme, 'border-radius');
207208

208209
&:hover,
209210
&:focus {
@@ -240,7 +241,7 @@
240241
}
241242

242243
&:focus {
243-
background: var-get($theme, 'item-active-background');
244+
background: var-get($theme, 'item-hover-background');
244245
color: var-get($theme, 'item-hover-color');
245246
border-bottom-color: transparent;
246247
}
@@ -268,14 +269,15 @@
268269
%tabs-header-item--selected {
269270
outline: 0;
270271
color: var-get($theme, 'item-active-color');
272+
background: var-get($theme, 'item-active-background');
271273

272274
&:hover,
273275
&:focus {
274-
background: var-get($theme, 'item-active-background');
275-
color: if($variant == 'fluent', var-get($theme, 'item-hover-color'), var-get($theme, 'item-active-color'));
276+
background: var-get($theme, 'item-active-hover-background');
277+
color: var-get($theme, 'item-active-hover-color');
276278

277279
igx-icon {
278-
color: var-get($theme, 'item-active-icon-color');
280+
color: var-get($theme, 'item-active-hover-icon-color');
279281
}
280282
}
281283

@@ -284,7 +286,6 @@
284286
}
285287

286288
@if $bootstrap-theme {
287-
background: var-get($theme, 'item-active-background');
288289
position: relative;
289290
box-shadow: inset 0 0 0 rem(1px) var-get($theme, 'border-color');
290291
z-index: 1;
@@ -310,6 +311,16 @@
310311

311312
&:hover {
312313
box-shadow: inset 0 0 0 rem(1px) var-get($theme, 'border-color');
314+
315+
&::before {
316+
background: linear-gradient(
317+
to right,
318+
var-get($theme, 'border-color') 1px,
319+
var-get($theme, 'item-active-hover-background') 1px,
320+
var-get($theme, 'item-active-hover-background') calc(100% - 1px),
321+
var-get($theme, 'border-color') calc(100% - 1px)
322+
);
323+
}
313324
}
314325
}
315326

@@ -318,21 +329,15 @@
318329
font-weight: 600;
319330
}
320331
}
321-
322-
@if $indigo-theme {
323-
&:hover,
324-
&:focus-within {
325-
background: var-get($theme, 'item-hover-background');
326-
}
327-
}
328332
}
329333

330334
%tabs-header-item:focus,
331335
%tabs-header-item--selected:focus {
332336
@if $bootstrap-theme {
333337
border: none;
334-
box-shadow: inset 0 0 0 rem(2px) var-get($theme, 'item-hover-color');
335-
border-radius: rem(4px);
338+
box-shadow: inset 0 0 0 rem(2px) var-get($theme, 'item-active-hover-color');
339+
border-bottom-left-radius: rem(4px);
340+
border-bottom-right-radius: rem(4px);
336341
z-index: 1;
337342

338343
&::after {

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)