@@ -4,6 +4,7 @@ import { BreakpointObserver } from '@angular/cdk/layout';
4
4
5
5
import { CollapseDirective } from '../collapse' ;
6
6
import { Colors } from '../coreui.types' ;
7
+ import { ThemeDirective } from '../shared' ;
7
8
8
9
// todo: fix container prop issue not rendering children
9
10
// todo: workaround - use <c-container> component directly in template
@@ -12,18 +13,17 @@ import { Colors } from '../coreui.types';
12
13
selector : 'c-navbar' ,
13
14
templateUrl : './navbar.component.html' ,
14
15
standalone : true ,
15
- imports : [ NgClass , NgTemplateOutlet ]
16
+ imports : [ NgClass , NgTemplateOutlet ] ,
17
+ hostDirectives : [
18
+ { directive : ThemeDirective , inputs : [ 'colorScheme' ] }
19
+ ]
16
20
} )
17
21
export class NavbarComponent implements AfterContentInit {
18
22
/**
19
23
* Sets the color context of the component to one of CoreUI’s themed colors.
20
24
* @type Colors
21
25
*/
22
26
@Input ( ) color ?: Colors ;
23
- /**
24
- * Sets if the color of text should be colored for a light or dark dark background.
25
- */
26
- @Input ( ) colorScheme ?: 'dark' | 'light' = 'light' ;
27
27
/**
28
28
* Defines optional container wrapping children elements.
29
29
*/
@@ -52,8 +52,6 @@ export class NavbarComponent implements AfterContentInit {
52
52
const expandClassSuffix : string = this . expand === true ? '' : `-${ this . expand } ` ;
53
53
return {
54
54
navbar : true ,
55
- 'navbar-light' : this . colorScheme === 'light' ,
56
- 'navbar-dark' : this . colorScheme === 'dark' ,
57
55
[ `navbar-expand${ expandClassSuffix } ` ] : ! ! this . expand ,
58
56
[ `bg-${ this . color } ` ] : ! ! this . color ,
59
57
[ `${ this . placement } ` ] : ! ! this . placement
0 commit comments