-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Expand file tree
/
Copy pathdatetime.ionic.scss
More file actions
260 lines (200 loc) · 6.54 KB
/
datetime.ionic.scss
File metadata and controls
260 lines (200 loc) · 6.54 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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
@use "../../themes/ionic/ionic.globals.scss" as globals;
@use "./datetime.common";
// Ionic Datetime
// --------------------------------------------------
:host {
/**
* @prop --focus-ring-color: The color of the ring around the focused element.
* @prop --focus-ring-width: The width of the ring around the focused element.
*/
--background: #{globals.$ion-bg-surface-default};
--focus-ring-color: #{globals.$ion-border-focus-default};
--focus-ring-width: #{globals.$ion-border-radius-025};
/**
* TODO(FW-6931): Remove these variables upon solving the root cause
*/
--body-opacity: 0;
--year-opacity: 0;
}
/**
* TODO(FW-6931): Remove all this css related to opacity upon solving the root cause
*/
:host .calendar-body {
opacity: var(--body-opacity);
}
:host .datetime-year {
opacity: var(--year-opacity);
}
:host(.datetime-ready) .calendar-body {
--body-opacity: 1;
}
:host(.datetime-ready) .datetime-year {
--year-opacity: 1;
}
// Header
// -----------------------------------
:host .datetime-header {
@include globals.padding(
globals.$ion-space-200,
globals.$ion-space-400,
globals.$ion-space-400,
globals.$ion-space-400
);
display: flex;
flex-direction: column;
align-items: start;
justify-content: space-between;
height: globals.$ion-scale-1400;
margin-bottom: globals.$ion-space-200;
border-bottom: globals.$ion-border-style-solid globals.$ion-border-size-025 globals.$ion-primitives-neutral-400;
}
:host .datetime-header .datetime-title {
@include globals.typography(globals.$ion-heading-h6-medium);
color: globals.$ion-primitives-neutral-800;
}
:host .datetime-header .datetime-selected-date {
@include globals.typography(globals.$ion-body-md-regular);
color: globals.$ion-primitives-neutral-1000;
}
// Calendar Header
// -----------------------------------
.calendar-action-buttons {
@include globals.padding(globals.$ion-space-200, null);
align-items: center;
height: globals.$ion-scale-1400;
box-sizing: border-box;
}
.calendar-month-year {
flex: 1 0 0;
}
// Month year toggle should match the
// default round clear button style
.calendar-month-year-toggle {
@include globals.border-radius(globals.$ion-border-radius-full);
@include globals.typography(globals.$ion-body-action-md);
@include globals.padding(globals.$ion-space-200, globals.$ion-space-400);
min-width: globals.$ion-scale-1600;
min-height: globals.$ion-scale-1000;
border: var(--focus-ring-width) globals.$ion-border-style-solid transparent;
color: globals.$ion-semantics-primary-base;
}
// Hovered Month Year Toggle
@media (any-hover: hover) {
.calendar-month-year-toggle:hover {
background: globals.$ion-primitives-neutral-200;
}
}
// Focused Month Year Toggle
.calendar-month-year-toggle.ion-focused {
border-color: var(--focus-ring-color);
}
// Activated Month Year Toggle
.calendar-month-year-toggle.ion-activated {
background: globals.$ion-primitives-neutral-200;
}
// TODO(ROU-11119): Rewrite this when we replace the ion-button with a native button
.calendar-next-prev ion-button.button-has-icon-only {
--color: #{globals.$ion-primitives-neutral-1000};
--background-activated: #{globals.$ion-primitives-neutral-200};
--background-hover: #{globals.$ion-primitives-neutral-200};
--background-hover-opacity: 1;
min-height: globals.$ion-scale-1000;
}
// TODO(ROU-11119): Rewrite this when we replace the ion-button with a native button
.calendar-next-prev ion-button.button-has-icon-only.ion-focused::part(native) {
border: globals.$ion-border-size-050 globals.$ion-border-style-solid globals.$ion-border-focus-default;
outline: none;
}
// Calendar Days of Week
// -----------------------------------
.calendar-days-of-week {
@include globals.typography(globals.$ion-overline-medium);
align-content: center;
height: globals.$ion-scale-1200;
color: globals.$ion-primitives-neutral-800;
}
// Calendar Day
// -----------------------------------
.calendar-day {
@include globals.border-radius(globals.$ion-border-radius-full);
@include globals.padding(globals.$ion-space-100);
@include globals.typography(globals.$ion-body-action-sm);
width: globals.$ion-scale-1200;
min-width: globals.$ion-scale-1200;
height: globals.$ion-scale-1200;
color: globals.$ion-text-default;
}
// Disabled Day
.calendar-day[disabled]:not(.calendar-day-constrained) {
color: globals.$ion-primitives-neutral-500;
}
// Current Day
.calendar-day.calendar-day-today {
color: globals.$ion-semantics-primary-base;
}
// Selected Day
.calendar-day.calendar-day-active,
.calendar-day.calendar-day-active.calendar-day-adjacent-day {
background: globals.$ion-semantics-primary-100;
}
// Focused Day
.calendar-day:focus-visible {
border: var(--focus-ring-width) globals.$ion-border-style-solid var(--focus-ring-color);
}
// Hovered Day
@media (any-hover: hover) {
.calendar-day:not([disabled]):not(:active):hover {
background: globals.$ion-semantics-primary-200;
}
}
// Pressed Day
.calendar-day:active,
.calendar-day.calendar-day-adjacent-day:active {
background: globals.$ion-bg-primary-subtle-press;
}
// Adjacent Day
.calendar-day.calendar-day-adjacent-day {
color: globals.$ion-text-subtlest;
}
// Selected Adjacent Day
.calendar-day.calendar-day-active.calendar-day-adjacent-day {
color: globals.$ion-text-default;
}
// Time / Header
// -----------------------------------
:host .datetime-time {
@include globals.padding(globals.$ion-space-100, globals.$ion-space-400);
}
:host .datetime-time .time-header {
@include globals.typography(globals.$ion-body-action-md);
color: globals.$ion-primitives-neutral-800;
}
:host .datetime-time button {
@include globals.padding(globals.$ion-space-0, globals.$ion-space-200);
@include globals.typography(globals.$ion-body-md-medium);
@include globals.border-radius(globals.$ion-border-radius-full);
display: flex;
align-items: center;
height: globals.$ion-scale-800;
background-color: globals.$ion-primitives-neutral-100;
color: globals.$ion-text-default;
}
// Calendar / Footer / Action Buttons
// -----------------------------------
:host .datetime-footer {
@include globals.padding(globals.$ion-space-200, 0, 0, 0);
@include globals.margin(globals.$ion-space-200, 0, 0, 0);
@include globals.border(
globals.$ion-border-style-solid globals.$ion-border-size-025 globals.$ion-primitives-neutral-400,
0,
0,
0
);
}
:host .datetime-buttons .datetime-action-buttons,
.datetime-action-buttons .datetime-action-buttons-container,
::slotted([slot="buttons"]) {
flex-flow: column;
align-items: stretch;
gap: globals.$ion-space-200;
}