-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Expand file tree
/
Copy pathdatetime.md.scss
More file actions
177 lines (135 loc) · 3.83 KB
/
datetime.md.scss
File metadata and controls
177 lines (135 loc) · 3.83 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
@import "./datetime.native.scss";
@import "./datetime.md.vars.scss";
@import "../../themes/native/native.globals.md";
// Material Design Datetime
// --------------------------------------------------
:host {
--background: var(--ion-datetime-background);
--title-color: #{current-color(contrast)};
}
// Header
// -----------------------------------
:host .datetime-header {
@include padding(
$datetime-md-header-padding,
$datetime-md-header-padding,
$datetime-md-header-padding,
$datetime-md-header-padding
);
background: current-color(base);
color: var(--title-color);
}
:host .datetime-header .datetime-title {
font-size: $datetime-md-title-font-size;
text-transform: uppercase;
}
:host .datetime-header .datetime-selected-date {
@include margin(30px, null, null, null);
font-size: $datetime-md-selected-date-font-size;
}
// Calendar / Header / Action Buttons
// -----------------------------------
:host .calendar-action-buttons ion-button {
--color: var(--ion-color-text-650);
}
.calendar-month-year-toggle {
@include padding(12px, 16px, 12px, #{$datetime-md-header-padding});
min-height: 48px;
background: transparent;
color: var(--ion-color-text-650);
z-index: 1;
&.ion-focused::after {
opacity: 0.04;
}
}
.calendar-month-year-toggle ion-ripple-effect {
color: currentColor;
}
@media (any-hover: hover) {
.calendar-month-year-toggle.ion-activatable:not(.ion-focused):hover {
&::after {
background: currentColor;
opacity: 0.04;
}
}
}
// Calendar / Header / Days of Week
// -----------------------------------
:host .calendar-days-of-week {
@include padding(0px, 10px, 0px, 10px);
color: var(--ion-color-text-500);
font-size: $datetime-md-calendar-item-font-size;
line-height: 36px;
}
// Calendar / Body
// -----------------------------------
:host .calendar-body .calendar-month .calendar-month-grid {
@include padding(4px, 10px);
/**
* Calendar on MD will show an empty row
* if not enough dates to fill 6th row.
* Calendar on iOS fits all dates into
* a fixed number of rows and resizes
* if necessary.
*/
grid-template-rows: repeat(6, 1fr);
}
// Individual day button in month
:host .calendar-day {
width: $datetime-md-day-width;
min-width: $datetime-md-day-width;
height: $datetime-md-day-height;
font-size: $datetime-md-calendar-item-font-size;
}
/**
* Day that today but not selected
* should have ion-color for text color.
*/
:host .calendar-day.calendar-day-today {
border: 1px solid current-color(base);
color: current-color(base);
}
/**
* Day that is not today but
* is selected should have ion-color for
* text color and be bolder.
*/
:host .calendar-day.calendar-day-active,
:host .calendar-day.calendar-day-adjacent-day.calendar-day-active {
color: current-color(contrast);
}
.calendar-day.calendar-day-active,
.calendar-day.calendar-day-active:focus {
border: 1px solid current-color(base);
background: current-color(base);
}
:host .calendar-day.calendar-day-adjacent-day {
color: var(--ion-color-text-500);
}
// Time / Header
// -----------------------------------
:host .datetime-time {
@include padding($datetime-md-padding * 0.5, $datetime-md-padding, $datetime-md-padding * 0.5, $datetime-md-padding);
}
:host .time-header {
color: var(--ion-color-text-650);
}
// Month and Year
// -----------------------------------
/**
* Add some margin when only selecting month/year
* otherwise layout will too constricted.
*/
:host(.datetime-presentation-month) .datetime-year,
:host(.datetime-presentation-year) .datetime-year,
:host(.datetime-presentation-month-year) .datetime-year {
@include margin(20px, null, 20px, null);
}
// Footer
// -----------------------------------
:host .datetime-buttons {
@include padding(10px, 10px, 10px, 10px);
display: flex;
align-items: center;
justify-content: flex-end;
}