1
- $md-datepicker-button-size : 48 px ;
1
+ // Space between the text input and the calendar-icon button.
2
2
$md-datepicker-button-gap : 12px ;
3
3
4
4
5
5
// Mixin for a "flat" input that can be used for components that contain an input
6
6
// (datepicker, autocomplete).
7
+ // TODO(jelbourn): actually use this w/ autocomplete.
7
8
@mixin md-flat-input () {
8
9
font-size : 14px ;
9
10
@@ -20,21 +21,16 @@ $md-datepicker-button-gap: 12px;
20
21
21
22
// The calendar icon button used to open the calendar pane.
22
23
// Need absurd specificty to override md-button.md-icon-button.
23
- .md-date-picker -button {
24
+ .md-datepicker -button {
24
25
display : inline-block ;
25
26
box-sizing : border-box ;
26
27
background : none ;
27
-
28
- & .md-open {
29
- fill : lightblue ;
30
- }
31
28
}
32
29
33
30
// The input into which the user can type the date.
34
31
.md-datepicker-input {
35
32
@include md-flat-input ();
36
33
width : 100% ;
37
- line-height : 21px ;
38
34
}
39
35
40
36
// Container for the datepicker input.
@@ -46,28 +42,11 @@ $md-datepicker-button-gap: 12px;
46
42
border-bottom : 1px solid #e0e0e0 ;
47
43
width : 120px ;
48
44
margin-left : $md-datepicker-button-gap ;
49
-
50
- & .md-open {
51
- border : 1px solid #e0e0e0 ;
52
- border-bottom : none ;
53
- min-width : $md-calendar-width ;
54
- margin-left : - $md-datepicker-button-gap ;
55
-
56
- .md-datepicker-input {
57
- margin-left : 24px ;
58
- // line-height: 40px;
59
- height : 40px ;
60
- }
61
-
62
- .md-datepicker-expand-triangle {
63
- display : none ;
64
- }
65
- }
66
45
}
67
46
68
47
69
48
// Floating pane that contains the calendar at the bottom of the input.
70
- .md-date -calendar-pane {
49
+ .md-datepicker -calendar-pane {
71
50
position : absolute ;
72
51
top : 0 ;
73
52
left : 0 ;
@@ -79,13 +58,32 @@ $md-datepicker-button-gap: 12px;
79
58
}
80
59
81
60
// Shadow that wraps around both the floating calendar pane and the in-line input.
82
- .md-date -calendar-pane-shadow {
61
+ .md-datepicker -calendar-pane-shadow {
83
62
position : absolute ;
84
63
z-index : $z-index-datepicker-shadow ;
85
64
width : $md-calendar-width ;
86
65
}
87
66
67
+ // Down "disclosure" triangle/arrow indicating that the datepicker can be opened.
68
+ // We can do this entirely with CSS without needing to load an icon.
69
+ // See https://css-tricks.com/snippets/css/css-triangle/
70
+ $md-date-arrow-size : 6px ;
71
+ .md-datepicker-expand-triangle {
72
+ // Center the triangle inside of the button so that the
73
+ // ink ripple origin looks correct.
74
+ position : absolute ;
75
+ top : 50% ;
76
+ left : 50% ;
77
+ transform : translate (-50% , -50% );
78
+
79
+ width : 0 ;
80
+ height : 0 ;
81
+ border-left : $md-date-arrow-size solid transparent ;
82
+ border-right : $md-date-arrow-size solid transparent ;
83
+ border-top : $md-date-arrow-size solid rgba (black , 0.20 );
84
+ }
88
85
86
+ // Button containing the down "disclosure" triangle/arrow.
89
87
.md-datepicker-triangle-button {
90
88
position : absolute ;
91
89
right : 0 ;
@@ -97,23 +95,32 @@ $md-datepicker-button-gap: 12px;
97
95
}
98
96
}
99
97
100
- // Need crazy specificity to override .md-button.md-icon-button
98
+ // Need crazy specificity to override .md-button.md-icon-button.
99
+ // Only apply this high specifiy to the property we need to override.
101
100
.md-datepicker-triangle-button.md-button.md-icon-button {
102
101
height : 100% ;
103
102
}
104
103
105
- $md-date-arrow-size : 6px ;
106
- .md-datepicker-expand-triangle {
107
- // Center the triangle inside of the button so that the
108
- // ink ripple origin looks correct.
109
- position : absolute ;
110
- top : 50% ;
111
- left : 50% ;
112
- transform : translate (-50% , -50% );
113
104
114
- width : 0 ;
115
- height : 0 ;
116
- border-left : $md-date-arrow-size solid transparent ;
117
- border-right : $md-date-arrow-size solid transparent ;
118
- border-top : $md-date-arrow-size solid rgba (black , 0.20 );
105
+ // Open state for all of the elements of the picker.
106
+ .md-datepicker-open {
107
+ .md-datepicker-input-container {
108
+ border : 1px solid #e0e0e0 ;
109
+ border-bottom : none ;
110
+ min-width : $md-calendar-width ;
111
+ margin-left : - $md-datepicker-button-gap ;
112
+ }
113
+
114
+ .md-datepicker-input {
115
+ margin-left : 24px ;
116
+ height : 40px ;
117
+ }
118
+
119
+ .md-datepicker-expand-triangle {
120
+ display : none ;
121
+ }
122
+
123
+ .md-datepicker-calendar-icon {
124
+ fill : #2196f3 ;
125
+ }
119
126
}
0 commit comments