Skip to content

Commit 61fa1ab

Browse files
adamwathanAnton P
authored andcommitted
Don't reset horizontal padding on date/time pseudo-elements (tailwindlabs#14959)
Turns out all of these date/time pseudo elements have a bit of horizontal padding on them that we don't want to throw away when fixing the height issue, so this PR updates our reset to only remove vertical padding. Here's a demo showing the difference, test in Safari or Chrome to see the difference in horizontal spacing: https://play.tailwindcss.com/Opwa7pkDFP?file=css --------- Co-authored-by: Adam Wathan <[email protected]>
1 parent 8c9e976 commit 61fa1ab

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

packages/tailwindcss/preflight.css

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ progress {
248248
1. Ensure date/time inputs have the same height when empty in iOS Safari.
249249
2. Ensure text alignment can be changed on date/time inputs in iOS Safari.
250250
*/
251+
251252
::-webkit-date-and-time-value {
252253
min-height: 1lh; /* 1 */
253254
text-align: inherit; /* 2 */
@@ -256,13 +257,19 @@ progress {
256257
/*
257258
Prevent height from changing on date/time inputs in macOS Safari when the input is set to `display: block`.
258259
*/
260+
259261
::-webkit-datetime-edit {
260262
display: inline-flex;
261263
}
262264

263265
/*
264266
Remove excess padding from pseudo-elements in date/time inputs to ensure consistent height across browsers.
265267
*/
268+
269+
::-webkit-datetime-edit-fields-wrapper {
270+
padding: 0;
271+
}
272+
266273
::-webkit-datetime-edit,
267274
::-webkit-datetime-edit-year-field,
268275
::-webkit-datetime-edit-month-field,
@@ -271,9 +278,8 @@ progress {
271278
::-webkit-datetime-edit-minute-field,
272279
::-webkit-datetime-edit-second-field,
273280
::-webkit-datetime-edit-millisecond-field,
274-
::-webkit-datetime-edit-meridiem-field,
275-
::-webkit-datetime-edit-fields-wrapper {
276-
padding: 0;
281+
::-webkit-datetime-edit-meridiem-field {
282+
padding-block: 0;
277283
}
278284

279285
/*

0 commit comments

Comments
 (0)