Skip to content

Commit 6ccdd0b

Browse files
authored
fix(navbar): nested components sizes (#15685)
1 parent f25403d commit 6ccdd0b

File tree

6 files changed

+41
-32
lines changed

6 files changed

+41
-32
lines changed

projects/igniteui-angular/src/lib/core/styles/components/icon-button/_icon-button-theme.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,6 @@
177177
);
178178

179179
igx-icon {
180-
// TODO: Why do we have to comment these out?
181-
// --component-size: var(--ig-size, var(--ig-size-large));
182-
// --size: var(--igx-icon-size, #{$icon-in-button-size});
183-
184180
--ig-size: #{if($variant == 'indigo', 2, 1)};
185181

186182
display: flex;

projects/igniteui-angular/src/lib/navbar/navbar.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<nav class="igx-navbar" role="navigation" [attr.aria-labelledby]="titleId">
1+
<nav role="navigation" [attr.aria-labelledby]="titleId">
22
<div class="igx-navbar__left">
33
@if (isActionButtonVisible) {
44
<igx-icon (click)="_triggerAction()">

projects/igniteui-angular/src/lib/navbar/navbar.component.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,6 @@ let NEXT_ID = 0;
4848
@Component({
4949
selector: 'igx-navbar',
5050
templateUrl: 'navbar.component.html',
51-
styles: [`
52-
:host {
53-
display: block;
54-
width: 100%;
55-
}
56-
`
57-
],
5851
styleUrl: 'navbar.component.css',
5952
encapsulation: ViewEncapsulation.None,
6053
imports: [IgxIconComponent]
@@ -71,6 +64,14 @@ export class IgxNavbarComponent {
7164
@Input()
7265
public id = `igx-navbar-${NEXT_ID++}`;
7366

67+
/**
68+
* @hidden
69+
* @internal
70+
*/
71+
@HostBinding('class.igx-navbar')
72+
public cssClass = 'igx-navbar';
73+
74+
7475
/**
7576
* Sets the icon of the `IgxNavbarComponent`.
7677
* ```html

projects/igniteui-angular/src/lib/navbar/themes/_base.scss

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ $_theme: $material;
2424

2525
igx-icon,
2626
igc-icon {
27-
--component-size: 3;
27+
--component-size: var(--ig-size, var(--ig-size-large));
2828
cursor: pointer;
2929
}
3030

@@ -55,29 +55,28 @@ $_theme: $material;
5555
}
5656

5757
@include b(igx-navbar) {
58-
display: flex;
59-
align-items: center;
60-
position: relative;
61-
flex-flow: row nowrap;
62-
gap: rem(16px);
58+
display: block;
6359
width: 100%;
64-
min-height: rem(56px);
65-
max-height: rem(128px);
66-
padding-inline: rem(16px);
6760
background: var-get($_theme, 'background');
6861
color: var-get($_theme, 'text-color');
6962
box-shadow: var-get($_theme, 'elevation');
70-
z-index: 4;
71-
overflow: hidden;
72-
border-bottom: rem(1px) solid var-get($_theme, 'border-color');
7363

74-
igx-avatar {
75-
--ig-size: 1;
64+
nav {
65+
display: flex;
66+
align-items: center;
67+
position: relative;
68+
flex-flow: row nowrap;
69+
gap: rem(16px);
70+
min-height: rem(56px);
71+
padding-inline: rem(16px);
72+
max-height: rem(128px);
73+
z-index: 4;
74+
overflow: hidden;
75+
border-bottom: rem(1px) solid var-get($_theme, 'border-color');
7676
}
7777

78-
[igxButton],
79-
[igxIconButton] {
80-
--ig-size: 2;
78+
igx-avatar {
79+
--ig-size: 1;
8180
}
8281

8382
@include e(title) {

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,21 @@
33
@use 'styles/themes/standalone' as *;
44

55
@include themed-block(igx-navbar, bootstrap) {
6+
[igxButton],
7+
[igxIconButton] {
8+
--ig-size: 2;
9+
}
10+
611
@include e(title) {
7-
@include type-style(h5);
12+
@include type-style(h5) {
13+
margin: 0;
14+
};
815
}
916

1017
igx-navbar-title,
1118
[igxNavbarTitle] {
12-
@include type-style(h5);
19+
@include type-style(h5) {
20+
margin: 0;
21+
};
1322
}
1423
}

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
%icon-size {
77
igx-icon,
88
igc-icon {
9-
--component-size: 2;
9+
--component-size: var(--ig-size, var(--ig-size-medium));
1010

1111
margin-inline: rem(6px);
1212
}
@@ -16,6 +16,10 @@
1616
--ig-size: 2;
1717
}
1818

19+
[igxIconButton] {
20+
--ig-size: 2;
21+
}
22+
1923
igx-navbar-title,
2024
[igxNavbarTitle] {
2125
@include type-style(h5);

0 commit comments

Comments
 (0)