Skip to content

Commit 6256779

Browse files
committed
Updated clear button style to match with the rest of directive.
1 parent 95f15c3 commit 6256779

File tree

2 files changed

+41
-23
lines changed

2 files changed

+41
-23
lines changed

src/datetime-input.css

Lines changed: 39 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -112,27 +112,6 @@
112112
}
113113

114114

115-
/**
116-
* Clear button
117-
*/
118-
.datetime-input.datetime .clear-button {
119-
border: none;
120-
float: right;
121-
color: #444;
122-
background-color: white;
123-
background-color: #efefef;
124-
border: 1px solid black;
125-
font-size: 22px;
126-
margin-bottom: -40px;
127-
margin-right: -1px;
128-
padding: 0 12px;
129-
height: 40px;
130-
}
131-
.datetime-input.datetime .clear-button:hover {
132-
background-color: #ddd;
133-
}
134-
135-
136115
/**
137116
* Calendar
138117
*/
@@ -340,3 +319,42 @@
340319
95% { opacity: 1.0; }
341320
100% { opacity: 0.0; }
342321
}
322+
323+
324+
/**
325+
* Clear button
326+
*/
327+
.datetime-input.datetime .clear-button {
328+
position: absolute;
329+
z-index: 5;
330+
bottom: -2.5em;
331+
right: -1px;
332+
cursor: pointer;
333+
outline: none;
334+
border: none;
335+
color: #777;
336+
width: 25%;
337+
height: auto;
338+
font-size: 1.5em;
339+
line-height: 2em;
340+
box-sizing: border-box;
341+
background-color: #efefef;
342+
transition: background-color 0.25s ease-out;
343+
}
344+
.datetime-input.datetime .clear-button::before {
345+
position: absolute;
346+
left: -1em;
347+
top: 0;
348+
width: 0;
349+
height: 0;
350+
content: "";
351+
border-top: 2em solid #efefef;
352+
border-left: 1em solid transparent;
353+
transition: border 0.25s ease-out;
354+
}
355+
.datetime-input.datetime .clear-button:hover {
356+
background-color: #ddd;
357+
}
358+
.datetime-input.datetime .clear-button:hover::before {
359+
border-top-color: #ddd;
360+
}

src/datetime-input.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@
5555
<div class="arrow arrow-down" ng-click="setDate(selected.clone().subtract(1, 'seconds'))"></div>
5656
</div>
5757
</div>
58-
<div ng-if="clearable">
59-
<button ng-click="clear()" class="clear-button">Clear</button>
58+
<div class="clear-button" ng-if="!!datetime">
59+
<div ng-click="setDate()">Clear</div>
6060
</div>
6161
</div>
6262
</div>

0 commit comments

Comments
 (0)