Skip to content

Commit 0c7f13a

Browse files
committed
Better styles and titles
1 parent 53c03e3 commit 0c7f13a

File tree

6 files changed

+34
-22
lines changed

6 files changed

+34
-22
lines changed

dist/react-datepicker.css

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@
149149
background-color: transparent;
150150
}
151151

152+
.datepicker__input-container {
153+
position: relative;
154+
}
155+
152156
.datepicker__input {
153157
position: relative;
154158
font-size: 13px;
@@ -172,27 +176,29 @@
172176
background-color: transparent;
173177
cursor: pointer;
174178
display: inline-block;
179+
height: 0;
175180
outline: 0;
176-
position: relative;
181+
padding: 0;
177182
vertical-align: middle;
178183
}
179184
.close-icon:after {
180185
content: "\00d7";
181186
display: block;
182-
width: 12px;
183-
height: 12px;
187+
width: 10px;
188+
height: 10px;
184189
position: absolute;
185190
background-color: #216ba5;
186191
z-index: 1;
187-
right: 20px;
188-
top: -4px;
192+
right: 4px;
193+
top: 50%;
189194
bottom: 0;
190-
margin: auto;
195+
margin: -5px auto 0;
191196
padding: 2px;
192197
border-radius: 50%;
193198
text-align: center;
194199
color: white;
195200
font-weight: normal;
196201
font-size: 10px;
197202
cursor: pointer;
203+
line-height: 0.8;
198204
}

dist/react-datepicker.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,14 +188,14 @@ return /******/ (function(modules) { // webpackBootstrap
188188
},
189189

190190
render: function render() {
191-
var closeButton = null;
191+
var clearButton = null;
192192
if (this.props.isClearable && this.state.selected != null) {
193-
closeButton = React.createElement("button", { className: "close-icon", onClick: this.clearSelected });
193+
clearButton = React.createElement("button", { className: "close-icon", onClick: this.clearSelected });
194194
}
195195

196196
return React.createElement(
197197
"div",
198-
null,
198+
{ className: "datepicker__input-container", ref: "sup" },
199199
React.createElement(DateInput, {
200200
name: this.props.name,
201201
date: this.state.selected,
@@ -212,7 +212,7 @@ return /******/ (function(modules) { // webpackBootstrap
212212
disabled: this.props.disabled,
213213
className: this.props.className,
214214
title: this.props.title }),
215-
closeButton,
215+
clearButton,
216216
this.props.disabled ? null : this.calendar()
217217
);
218218
}

dist/react-datepicker.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/react-datepicker.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/datepicker.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,15 @@ var DatePicker = React.createClass( {
129129
},
130130

131131
render: function() {
132-
var closeButton = null;
132+
var clearButton = null;
133133
if ( this.props.isClearable && this.state.selected != null ) {
134-
closeButton = (
134+
clearButton = (
135135
<button className="close-icon" onClick={this.clearSelected}></button>
136136
);
137137
}
138138

139139
return (
140-
<div>
140+
<div className="datepicker__input-container">
141141
<DateInput
142142
name={this.props.name}
143143
date={this.state.selected}
@@ -154,7 +154,7 @@ var DatePicker = React.createClass( {
154154
disabled={this.props.disabled}
155155
className={this.props.className}
156156
title={this.props.title} />
157-
{closeButton}
157+
{clearButton}
158158
{this.props.disabled ? null : this.calendar()}
159159
</div>
160160
);

src/stylesheets/datepicker.scss

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@
125125
}
126126
}
127127

128+
.datepicker__input-container {
129+
position: relative;
130+
}
131+
128132
.datepicker__input {
129133
position: relative;
130134
font-size: 13px;
@@ -150,28 +154,30 @@
150154
background-color: transparent;
151155
cursor: pointer;
152156
display: inline-block;
157+
height: 0;
153158
outline: 0;
154-
position: relative;
159+
padding: 0;
155160
vertical-align: middle;
156161

157162
&:after {
158163
content: "\00d7";
159164
display: block;
160-
width: 12px;
161-
height: 12px;
165+
width: 10px;
166+
height: 10px;
162167
position: absolute;
163168
background-color: $selected-color;
164169
z-index: 1;
165-
right: 20px;
166-
top: -4px;
170+
right: 4px;
171+
top: 50%;
167172
bottom: 0;
168-
margin: auto;
173+
margin: -5px auto 0;
169174
padding: 2px;
170175
border-radius: 50%;
171176
text-align: center;
172177
color: white;
173178
font-weight: normal;
174179
font-size: 10px;
175180
cursor: pointer;
181+
line-height: 0.8;
176182
}
177183
}

0 commit comments

Comments
 (0)