Skip to content

Commit 2394308

Browse files
authored
refactor(bottom-nav): bundle styles with component (#15520)
1 parent 1819565 commit 2394308

File tree

17 files changed

+216
-18
lines changed

17 files changed

+216
-18
lines changed

projects/igniteui-angular/src/lib/core/styles/themes/generators/_base.scss

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -160,13 +160,13 @@
160160
// @include badge($badge-theme-map);
161161
// }
162162

163-
@if is-used('igx-bottom-nav', $exclude) {
164-
$bottom-nav-theme-map: bottom-nav-theme(
165-
$schema: $schema,
166-
);
167-
$bottom-nav-theme-map: meta.call($theme-handler, $bottom-nav-theme-map);
168-
@include bottom-nav($bottom-nav-theme-map);
169-
}
163+
// @if is-used('igx-bottom-nav', $exclude) {
164+
// $bottom-nav-theme-map: bottom-nav-theme(
165+
// $schema: $schema,
166+
// );
167+
// $bottom-nav-theme-map: meta.call($theme-handler, $bottom-nav-theme-map);
168+
// @include bottom-nav($bottom-nav-theme-map);
169+
// }
170170

171171
@if is-used('igx-button', $exclude) {
172172
$button-theme-map: button-theme(

projects/igniteui-angular/src/lib/core/styles/typography/_bootstrap.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
@mixin typography($type-scale) {
3838
@include badge-typography();
3939
// @include banner-typography();
40-
@include bottom-nav-typography();
40+
// @include bottom-nav-typography();
4141
@include button-typography();
4242
@include button-group-typography();
4343
@include calendar-typography($categories: (

projects/igniteui-angular/src/lib/core/styles/typography/_fluent.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
// @include banner-typography($categories: (
3939
// message: 'caption'
4040
// ));
41-
@include bottom-nav-typography();
41+
// @include bottom-nav-typography();
4242
@include button-typography();
4343
@include button-group-typography();
4444
@include calendar-typography($categories: (

projects/igniteui-angular/src/lib/core/styles/typography/_indigo.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
text: 'button',
3939
));
4040
// @include banner-typography();
41-
@include bottom-nav-typography();
41+
// @include bottom-nav-typography();
4242
@include button-typography();
4343
@include button-group-typography($categories: (
4444
text: 'body-2',

projects/igniteui-angular/src/lib/core/styles/typography/_material.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
@mixin typography() {
3737
@include badge-typography();
3838
// @include banner-typography();
39-
@include bottom-nav-typography();
39+
// @include bottom-nav-typography();
4040
@include button-typography();
4141
@include button-group-typography();
4242
@include calendar-typography();

projects/igniteui-angular/src/lib/tabs/bottom-nav/bottom-nav-content.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import { Component, HostBinding } from '@angular/core';
1+
import { Component, HostBinding, ViewEncapsulation } from '@angular/core';
22
import { IgxTabContentDirective } from '../tab-content.directive';
33
import { IgxTabContentBase } from '../tabs.base';
44

55
@Component({
66
selector: 'igx-bottom-nav-content',
77
templateUrl: 'bottom-nav-content.component.html',
8+
encapsulation: ViewEncapsulation.None,
89
providers: [{ provide: IgxTabContentBase, useExisting: IgxBottomNavContentComponent }],
910
imports: []
1011
})

projects/igniteui-angular/src/lib/tabs/bottom-nav/bottom-nav-header.component.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import { Component, HostBinding } from '@angular/core';
1+
import { Component, HostBinding, ViewEncapsulation } from '@angular/core';
22
import { IgxTabHeaderDirective } from '../tab-header.directive';
33
import { IgxTabHeaderBase } from '../tabs.base';
44

55
@Component({
66
selector: 'igx-bottom-nav-header',
77
templateUrl: 'bottom-nav-header.component.html',
8+
encapsulation: ViewEncapsulation.None,
89
providers: [{ provide: IgxTabHeaderBase, useExisting: IgxBottomNavHeaderComponent }],
910
standalone: true
1011
})
@@ -24,7 +25,5 @@ export class IgxBottomNavHeaderComponent extends IgxTabHeaderDirective {
2425

2526
/** @hidden */
2627
@HostBinding('class.igx-bottom-nav__menu-item')
27-
public get cssClass(): boolean {
28-
return (!this.tab.disabled && !this.tab.selected);
29-
}
28+
public readonly cssClass = 'igx-bottom-nav__menu-item';
3029
}

projects/igniteui-angular/src/lib/tabs/bottom-nav/bottom-nav-item.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import { Component } from '@angular/core';
1+
import { Component, ViewEncapsulation } from '@angular/core';
22
import { IgxTabItemDirective } from '../tab-item.directive';
33

44
@Component({
55
selector: 'igx-bottom-nav-item',
66
templateUrl: 'bottom-nav-item.component.html',
7+
encapsulation: ViewEncapsulation.None,
78
providers: [{ provide: IgxTabItemDirective, useExisting: IgxBottomNavItemComponent }],
89
standalone: true
910
})
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@use 'themes/base';
2+
@use 'themes/shared';
3+
@use 'themes/light';
4+
@use 'themes/dark';

projects/igniteui-angular/src/lib/tabs/bottom-nav/bottom-nav.component.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component } from '@angular/core';
1+
import { Component, HostBinding, ViewEncapsulation } from '@angular/core';
22
import { IgxTabsBase } from '../tabs.base';
33
import { IgxTabsDirective } from '../tabs.directive';
44
import { NgTemplateOutlet } from '@angular/common';
@@ -41,15 +41,22 @@ let NEXT_BOTTOM_NAV_ITEM_ID = 0;
4141
@Component({
4242
selector: 'igx-bottom-nav',
4343
templateUrl: 'bottom-nav.component.html',
44+
styleUrl: 'bottom-nav.component.css',
45+
encapsulation: ViewEncapsulation.None,
4446
providers: [{ provide: IgxTabsBase, useExisting: IgxBottomNavComponent }],
4547
imports: [NgTemplateOutlet]
4648
})
4749
export class IgxBottomNavComponent extends IgxTabsDirective {
4850
/** @hidden */
4951
public override disableAnimation = true;
52+
5053
/** @hidden */
5154
protected override componentName = 'igx-bottom-nav';
5255

56+
/** @hidden @internal */
57+
@HostBinding('class.igx-bottom-nav')
58+
public readonly hostClass = 'igx-bottom-nav';
59+
5360
/** @hidden */
5461
protected getNextTabId() {
5562
return NEXT_BOTTOM_NAV_ITEM_ID++;

0 commit comments

Comments
 (0)