-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Expand file tree
/
Copy pathdatetime.native.scss
More file actions
149 lines (116 loc) · 3.52 KB
/
datetime.native.scss
File metadata and controls
149 lines (116 loc) · 3.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
@use "../../themes/native/native.globals" as globals;
@use "./datetime.common";
// Datetime: Native Styles
// --------------------------------------------------
:host {
/**
* @prop --background-rgb: The primary background of the datetime component in RGB format.
* @prop --title-color: The text color of the title.
*
* @prop --wheel-highlight-background: The background of the highlight under the selected
* item when using a wheel style layout, or in the month/year picker for grid style layouts.
* @prop --wheel-highlight-border-radius: The border radius of the highlight under the selected
* item when using a wheel style layout, or in the month/year picker for grid style layouts.
* @prop --wheel-fade-background-rgb: The color of the gradient covering non-selected items
* when using a wheel style layout, or in the month/year picker for grid style layouts. Must
* be in RGB format, e.g. `255, 255, 255`.
*/
}
:host(.datetime-size-fixed:not(.datetime-prefer-wheel)) {
max-width: 350px;
}
/**
* TODO(FW-6931): Move this back to common file upon solving the root cause
*/
:host .calendar-body,
:host .datetime-year {
opacity: 0;
}
/**
* TODO(FW-6931): Move this back to common file upon solving the root cause
*/
:host(.datetime-ready) .calendar-body,
:host(.datetime-ready) .datetime-year {
opacity: 1;
}
/**
* This ensures that the picker is appropriately
* sized and never truncates the text.
*/
:host(.datetime-size-fixed.datetime-prefer-wheel) {
min-width: 350px;
max-width: max-content;
}
:host .calendar-action-buttons ion-button {
--background: transparent;
}
/**
* Center the day text vertically
* and horizontally within its grid cell.
*/
.calendar-day {
@include globals.border-radius(50%);
font-family: globals.$font-family-base;
}
:host .calendar-day[disabled] {
opacity: 0.4;
}
.calendar-day:not(.calendar-day-adjacent-day):focus {
background: current-color(base, 0.2);
box-shadow: 0px 0px 0px 4px current-color(base, 0.2);
}
.calendar-day:focus {
background: globals.current-color(base, 0.2);
box-shadow: 0px 0px 0px 4px globals.current-color(base, 0.2);
}
// Time / Header
// -----------------------------------
:host(.datetime-presentation-time) .datetime-time {
@include globals.padding(0);
}
:host ion-popover {
--height: 200px;
}
:host .time-body {
@include globals.border-radius(8px);
@include globals.padding(6px, 12px, 6px, 12px);
background: var(--ion-datetime-time-body-background);
color: globals.$text-color;
}
:host .time-body-active {
color: globals.current-color(base);
}
// Year Picker
// -----------------------------------
:host(.show-month-and-year) .calendar-action-buttons .calendar-month-year-toggle {
color: globals.current-color(base);
}
.calendar-month-year-toggle {
&::after {
@include globals.button-state();
transition: opacity 15ms linear, background-color 15ms linear;
z-index: -1;
}
&.ion-focused::after {
background: currentColor;
}
&:disabled {
opacity: 0.3;
pointer-events: none;
}
}
.calendar-month-year-toggle ion-icon {
@include globals.padding(0, 0, 0, 4px);
}
// Picker Custom Variables
// -----------------------------------
ion-picker {
--highlight-background: var(--wheel-highlight-background);
--highlight-border-radius: var(--wheel-highlight-border-radius);
--fade-background-rgb: var(--wheel-fade-background-rgb);
}
// Calendar / Footer / Action Buttons
// -----------------------------------
:host .datetime-action-buttons ion-buttons {
justify-content: space-between;
}