Skip to content

Commit fdb29a4

Browse files
committed
Customizer: Improve input field widths and alignment for date/time controls.
This changeset fixes some issues where Select fields were misaligned with neighboring elements, creating visual inconsistency in the customizer. Props rkradadiya, mukesh27, laxman-prajapati, dlh, karmatosed, ankitkumarshah, sabernhardt. Fixes #51249. git-svn-id: https://develop.svn.wordpress.org/trunk@59942 602fd350-edb4-49c9-b593-d223f7449a82
1 parent b6835c1 commit fdb29a4

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/wp-admin/css/customize-controls.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,10 @@ body.trashing #publish-settings {
365365
width: 46px;
366366
}
367367

368+
.customize-control-date_time select {
369+
vertical-align: top;
370+
}
371+
368372
.date-time-fields .date-input.year {
369373
width: 65px;
370374
}

src/wp-includes/customize/class-wp-customize-date-time-control.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public function content_template() {
154154
esc_html_e( 'Day' );
155155
?>
156156
</label>
157-
<input id="{{ idPrefix }}date-time-day" type="number" size="2" autocomplete="off" class="date-input day" data-component="day" min="1" max="31" />
157+
<input id="{{ idPrefix }}date-time-day" type="number" size="2" autocomplete="off" class="date-input day tiny-text" data-component="day" min="1" max="31" />
158158
<?php $day_field = trim( ob_get_clean() ); ?>
159159

160160
<?php ob_start(); ?>
@@ -164,7 +164,7 @@ public function content_template() {
164164
esc_html_e( 'Year' );
165165
?>
166166
</label>
167-
<input id="{{ idPrefix }}date-time-year" type="number" size="4" autocomplete="off" class="date-input year" data-component="year" min="{{ data.minYear }}" max="{{ data.maxYear }}">
167+
<input id="{{ idPrefix }}date-time-year" type="number" size="4" autocomplete="off" class="date-input year tiny-text" data-component="year" min="{{ data.minYear }}" max="{{ data.maxYear }}">
168168
<?php $year_field = trim( ob_get_clean() ); ?>
169169

170170
<?php printf( $date_format, $year_field, $month_field, $day_field ); ?>
@@ -182,15 +182,15 @@ public function content_template() {
182182
</label>
183183
<# var maxHour = data.twelveHourFormat ? 12 : 23; #>
184184
<# var minHour = data.twelveHourFormat ? 1 : 0; #>
185-
<input id="{{ idPrefix }}date-time-hour" type="number" size="2" autocomplete="off" class="date-input hour" data-component="hour" min="{{ minHour }}" max="{{ maxHour }}">
185+
<input id="{{ idPrefix }}date-time-hour" type="number" size="2" autocomplete="off" class="date-input hour tiny-text" data-component="hour" min="{{ minHour }}" max="{{ maxHour }}">
186186
:
187187
<label for="{{ idPrefix }}date-time-minute" class="screen-reader-text">
188188
<?php
189189
/* translators: Hidden accessibility text. */
190190
esc_html_e( 'Minute' );
191191
?>
192192
</label>
193-
<input id="{{ idPrefix }}date-time-minute" type="number" size="2" autocomplete="off" class="date-input minute" data-component="minute" min="0" max="59">
193+
<input id="{{ idPrefix }}date-time-minute" type="number" size="2" autocomplete="off" class="date-input minute tiny-text" data-component="minute" min="0" max="59">
194194
<# if ( data.twelveHourFormat ) { #>
195195
<label for="{{ idPrefix }}date-time-meridian" class="screen-reader-text">
196196
<?php

0 commit comments

Comments
 (0)