Skip to content

Commit dac3e25

Browse files
authored
make toolbar items flex (#66)
1 parent d124b86 commit dac3e25

File tree

3 files changed

+51
-27
lines changed

3 files changed

+51
-27
lines changed

projects/lib-workspace/src/app/app.component.html

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,25 @@
1414
</button>
1515
</fs-nav-frame-toolbar-center>
1616

17-
<fs-nav-frame-toolbar-end>
18-
<div style="font-size: 12px">
19-
<mat-form-field appearance="outline" dense>
20-
<mat-label>Search</mat-label>
21-
<input matInput placeholder="Searching..." />
22-
</mat-form-field>
23-
</div>
17+
<fs-nav-frame-toolbar-end style="gap: 1rem">
18+
<mat-form-field appearance="outline" class="dense-search">
19+
<mat-label>Search</mat-label>
20+
<input matInput placeholder="Searching..." />
21+
</mat-form-field>
22+
<button mat-icon-button>
23+
<mat-icon>notifications</mat-icon>
24+
</button>
2425
</fs-nav-frame-toolbar-end>
2526
</fs-nav-frame-toolbar>
2627

2728
<fs-nav-frame-sidebar>
28-
29-
<fs-nav-frame-sidebar-item *ngFor="let route of navRoutes" routerLink="{{route.path}}">
30-
<i class="material-icons">{{route.icon}}</i>
31-
<span>{{route.title}}</span>
29+
<fs-nav-frame-sidebar-item *ngFor="let route of navRoutes" routerLink="{{ route.path }}">
30+
<i class="material-icons">{{ route.icon }}</i>
31+
<span>{{ route.title }}</span>
3232
</fs-nav-frame-sidebar-item>
33-
3433
</fs-nav-frame-sidebar>
3534

36-
<fs-nav-user-profile >
35+
<fs-nav-user-profile>
3736
<!-- profilePicture="https://material.angular.io/assets/img/examples/shiba1.jpg" -->
3837
<fs-nav-user-profile-name>Some User</fs-nav-user-profile-name>
3938
<fs-nav-user-profile-subname>Enginer</fs-nav-user-profile-subname>

projects/lib-workspace/src/styles.scss

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,32 @@
1010
@include fsc.core();
1111
@include fsc.roboto();
1212

13-
$my-typography: mat.define-typography-config($font-family: 'Roboto-local');
13+
$my-typography: mat.define-typography-config(
14+
$font-family: 'Roboto-local',
15+
);
1416

1517
// Define a dark theme
16-
$dark-theme: mat.define-dark-theme((color: (primary: mat.define-palette(palettes.$md-primary),
17-
accent: mat.define-palette(palettes.$md-accent),
18-
),
19-
// Only include `typography` and `density` in the default dark theme.
20-
typography: $my-typography,
21-
density: 0,
22-
));
18+
$dark-theme: mat.define-dark-theme(
19+
(
20+
color: (
21+
primary: mat.define-palette(palettes.$md-primary),
22+
accent: mat.define-palette(palettes.$md-accent),
23+
),
24+
// Only include `typography` and `density` in the default dark theme.
25+
typography: $my-typography,
26+
density: 0,
27+
)
28+
);
2329

2430
// Define a light theme
25-
$light-theme: mat.define-light-theme((color: (primary: mat.define-palette(palettes.$md-primary),
26-
accent: mat.define-palette(palettes.$md-accent),
27-
),
28-
));
31+
$light-theme: mat.define-light-theme(
32+
(
33+
color: (
34+
primary: mat.define-palette(palettes.$md-primary),
35+
accent: mat.define-palette(palettes.$md-accent),
36+
),
37+
)
38+
);
2939

3040
// Apply the dark theme by default
3141
@include mat.all-component-themes($dark-theme);
@@ -41,4 +51,12 @@ $light-theme: mat.define-light-theme((color: (primary: mat.define-palette(palett
4151

4252
html * {
4353
font-family: 'Roboto-local';
44-
}
54+
}
55+
56+
.dense-search {
57+
@include mat.form-field-density(-5);
58+
59+
.mat-mdc-form-field-subscript-wrapper {
60+
display: none;
61+
}
62+
}

projects/ng-mat-components/src/fs-nav-frame/nav-frame-toolbar/fs-nav-frame-toolbar.component.scss

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@
2020
display: flex;
2121
align-items: center;
2222
justify-content: space-between;
23+
24+
fs-nav-frame-toolbar-start,
25+
fs-nav-frame-toolbar-center,
26+
fs-nav-frame-toolbar-end {
27+
display: inline-flex;
28+
align-items: center;
29+
}
2330
}
2431

2532
.mat-badge-medium.mat-badge-above .mat-badge-content {
@@ -32,4 +39,4 @@
3239

3340
button.mat-badge {
3441
margin: 0 4px;
35-
}
42+
}

0 commit comments

Comments
 (0)