Skip to content

Commit 50475e3

Browse files
committed
style(daterange): Add styling sample #1574, #1847
1 parent 7330aa5 commit 50475e3

File tree

3 files changed

+67
-2
lines changed

3 files changed

+67
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
1-
<igx-date-range-picker value="range"></igx-date-range-picker>
1+
<div class="date-picker-wrapper">
2+
<igx-date-range-picker [(ngModel)]="range" [overlaySettings]="{ outlet: element }">
3+
<igx-date-range-start>
4+
<input igxInput igxDateTimeEditor type="text">
5+
<igx-picker-toggle igxPrefix>
6+
<igx-icon>calendar_today</igx-icon>
7+
</igx-picker-toggle>
8+
</igx-date-range-start>
9+
<igx-date-range-end>
10+
<input igxInput igxDateTimeEditor type="text">
11+
</igx-date-range-end>
12+
</igx-date-range-picker>
13+
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// in component.scss
2+
@import '~igniteui-angular/lib/core/styles/themes/index';
3+
4+
// common
5+
$purple: #9E379F;
6+
$blue: #61AEDB;
7+
8+
$custom-palette: igx-palette($primary: $blue, $secondary: $purple);
9+
10+
$today-text: igx-color($custom-palette, "primary", 500);
11+
$text-color: igx-color($custom-palette, "secondary", 200);
12+
$color-focused: igx-color($custom-palette, "secondary", 500);
13+
14+
15+
// DATE-RANGE
16+
$custom-date-range-theme: igx-date-range-picker-theme(
17+
$label-color: $color-focused
18+
);
19+
20+
// INPUT GROUP
21+
$input-group-theme: igx-input-group-theme(
22+
$palette: $custom-palette,
23+
$filled-text-color: $text-color,
24+
$idle-text-color: $text-color,
25+
$focused-text-color: $color-focused,
26+
$hover-bottom-line-color: $color-focused,
27+
$idle-bottom-line-color: $purple
28+
);
29+
30+
// CALENDAR styling specific overlay component requires outlet -> [overlaySettings]="{ outlet: element }"
31+
$roundness: 0.5;
32+
$custom-calendar-theme: igx-calendar-theme(
33+
$palette: $custom-palette,
34+
$date-current-text-color: $today-text,
35+
$border-radius: $roundness,
36+
$date-border-radius: $roundness
37+
);
38+
39+
:host {
40+
::ng-deep {
41+
@include igx-date-range-picker($custom-date-range-theme);
42+
@include igx-input-group($input-group-theme);
43+
@include igx-calendar($custom-calendar-theme);
44+
}
45+
}
46+
47+
.date-picker-wrapper {
48+
padding: 1rem;
49+
max-width: 400px;
50+
}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component } from "@angular/core";
1+
import { Component, ElementRef } from "@angular/core";
22

33
@Component({
44
selector: "styled-rangedatepicker",
@@ -7,4 +7,7 @@ import { Component } from "@angular/core";
77
})
88
export class StyledDateRangePickerComponent {
99
public range = { start: new Date(), end: new Date(new Date().setDate(new Date().getDate() + 5)) };
10+
11+
constructor(public element: ElementRef) {
12+
}
1013
}

0 commit comments

Comments
 (0)