Skip to content

Commit d2fd0cf

Browse files
committed
feature(Datepicker) modal styling #557
1 parent c086241 commit d2fd0cf

File tree

2 files changed

+20
-11
lines changed

2 files changed

+20
-11
lines changed

components/datepicker/_datepicker.scss

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
1-
/* Modal */
2-
// @removed since v2.2.1
3-
/*.datepicker-modal {
4-
max-width: 325px;
5-
// @removed since v2.2.1-dev regarding Material M3 standards
6-
min-width: 300px;
7-
max-height: none;
8-
}*/
1+
@use './mixins.module.scss' as *;
92

103
.datepicker-container {
114
display: flex;
125
flex-direction: column;
136
max-width: 325px;
147
padding: 0;
15-
background-color: var(--md-sys-color-surface);
8+
background-color: var(--md-sys-color-inverse-on-surface);
169
}
1710

1811
.datepicker-controls {
@@ -34,8 +27,8 @@
3427
text-align: center;
3528

3629
&:focus {
37-
border-bottom: none;
38-
background-color: var(--md-sys-color-primary-container);
30+
color: var(--md-sys-color-primary);
31+
background-color: color-mix(in srgb, transparent, var(--md-sys-color-primary) 20%);
3932
}
4033

4134
&::selection {
@@ -70,6 +63,12 @@
7063
.month-next {
7164
display: inline-flex;
7265
align-items: center;
66+
67+
@include btn($height: 49px);
68+
69+
&:focus {
70+
background-color: color-mix(in srgb, transparent, var(--md-sys-color-primary) 20%);
71+
}
7372
}
7473

7574
.month-prev > svg,
@@ -261,3 +260,9 @@
261260
color: var(--md-sys-color-error);
262261
}
263262

263+
/* Display modes */
264+
.datepicker-modal {
265+
max-width: calc(325px + var(--modal-padding)*2);
266+
max-height: none;
267+
background-color: var(--md-sys-color-inverse-on-surface);
268+
}

sass/_global.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,10 @@ $spacing-values: ("0": 0, "1": 0.25rem, "2": 0.5rem, "3": 0.75rem, "4": 1rem, "5
478478
visibility: hidden;
479479
}
480480

481+
.confirmation-btns {
482+
margin-left: auto;
483+
}
484+
481485
/* This is needed for some mobile phones to display the Google Icon font properly */
482486
.material-icons, .material-symbols-outlined,
483487
.material-symbols-rounded, .material-symbols-sharp {

0 commit comments

Comments
 (0)