Skip to content

Commit d2c547a

Browse files
committed
feature(Timepicker) modal display plugin styling materializecss#557
1 parent 799c746 commit d2c547a

File tree

2 files changed

+76
-4
lines changed

2 files changed

+76
-4
lines changed

sass/components/_modal.scss

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,23 @@
4040
flex-shrink: 0;
4141
position: sticky;
4242
top: 0;
43-
background-color: var(--modal-background-color);
43+
// disabled since background color inheritance from parent element
44+
// background-color: var(--modal-background-color);
4445
}
4546
.modal-content {
4647
padding: 0 var(--modal-padding);
4748
}
4849
.modal-footer {
50+
display: flex;
4951
border-radius: 0 0 var(--modal-border-radius) var(--modal-border-radius);
5052
padding: var(--modal-padding);
5153
text-align: right;
5254
flex-shrink: 0;
5355
position: sticky;
5456
bottom: 0;
55-
background-color: var(--modal-background-color);
57+
// disabled since background color inheritance from parent element
58+
// background-color: var(--modal-background-color);
59+
justify-content: space-between;
5660
}
5761

5862
.modal-close {

sass/components/_timepicker.scss

Lines changed: 70 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
width: auto;
1818
flex: 1 auto;
1919
// background-color: var(--md-sys-color-surface);
20-
padding: 2rem .67rem .67rem .67rem;
20+
padding: 2rem .71rem .67rem .71rem;
2121
font-weight: 300;
2222
}
2323

@@ -51,7 +51,7 @@
5151

5252
.timepicker-input-hours-wrapper,
5353
.timepicker-input-minutes-wrapper {
54-
width: 6.9rem;
54+
width: 6.85rem;
5555
height: 5.75rem;
5656
}
5757

@@ -231,6 +231,38 @@ input[type=text].timepicker-input-minutes {
231231
padding: 0 20px;
232232
}
233233

234+
/* Display modes */
235+
.timepicker-modal {
236+
max-width: 326px;
237+
max-height: none;
238+
background-color: var(--md-sys-color-inverse-on-surface);
239+
overflow-x: hidden;
240+
241+
// Reset margins and paddings since they are defined by the modal instance
242+
.timepicker-container {
243+
margin-left: calc(-1 * var(--modal-padding));
244+
margin-right: calc(-1 * var(--modal-padding));
245+
}
246+
247+
.modal-header + .modal-content {
248+
.timepicker-digital-display {
249+
padding-top: 0;
250+
}
251+
252+
.timepicker-text-container {
253+
padding-top: 4px;
254+
}
255+
}
256+
257+
.timepicker-analog-display {
258+
padding-bottom: 0;
259+
}
260+
261+
.timepicker-plate {
262+
margin-bottom: 0;
263+
}
264+
}
265+
234266
/* Media Queries */
235267
@media #{$large-and-up} {
236268
.timepicker-container {
@@ -265,6 +297,11 @@ input[type=text].timepicker-input-minutes {
265297
display: flex;
266298
flex-grow: 1;
267299
max-width: unset;
300+
/*width: 100%;
301+
padding: 0 4%;
302+
flex-wrap: wrap;
303+
flex-direction: row;
304+
display: flex;*/
268305
}
269306

270307
.timepicker-container .am-btn,
@@ -291,4 +328,35 @@ input[type=text].timepicker-input-minutes {
291328
.timepicker-plate {
292329
margin-top: 1.6rem;
293330
}
331+
332+
/* Display modes */
333+
.timepicker-modal {
334+
width: 65%;
335+
max-width: 605px;
336+
337+
.modal-header + .modal-content {
338+
.timepicker-digital-display,
339+
.timepicker-analog-display {
340+
padding-top: 0;
341+
}
342+
343+
.timepicker-text-container {
344+
margin-top: 2.4rem;
345+
}
346+
347+
.timepicker-plate {
348+
margin-top: 4px;
349+
margin-bottom: 0;
350+
}
351+
}
352+
353+
.timepicker-digital-display,
354+
.timepicker-analog-display {
355+
padding-bottom: 0;
356+
}
357+
358+
.timepicker-plate {
359+
margin-bottom: 0;
360+
}
361+
}
294362
}

0 commit comments

Comments
 (0)