Skip to content

Commit 94c825a

Browse files
author
Tobias Schweizer
committed
refactor (MatCalendarHeader): style custom header
1 parent d81db60 commit 94c825a

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<div>
2-
<button (click)="previousClicked('year')">&lt;&lt;</button>
3-
<button (click)="previousClicked('month')">&lt;</button>
4-
{{periodLabel}}
5-
<button (click)="nextClicked('month')">&gt;</button>
6-
<button (click)="nextClicked('year')">&gt;&gt;</button>
1+
<div class="custom-header">
2+
<button mat-icon-button (click)="previousClicked('year')">&lt;&lt;</button>
3+
<button mat-icon-button (click)="previousClicked('month')">&lt;</button>
4+
<span class="custom-header-label">{{periodLabel}}</span>
5+
<button mat-icon-button (click)="nextClicked('month')">&gt;</button>
6+
<button mat-icon-button (click)="nextClicked('year')">&gt;&gt;</button>
77
</div>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.custom-header {
2+
padding: 1.5em;
3+
display: flex;
4+
}
5+
6+
.custom-header-label {
7+
flex: 1;
8+
text-align: center;
9+
}
10+

src/demo-app/datepicker/datepicker-demo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export class DatepickerDemo {
5151
moduleId: module.id,
5252
selector: 'custom-header',
5353
templateUrl: 'custom-header.html',
54-
styleUrls: [],
54+
styleUrls: ['custom-header.css'],
5555
changeDetection: ChangeDetectionStrategy.OnPush,
5656
})
5757
export class CustomHeader<D> {

0 commit comments

Comments
 (0)