Skip to content

Commit 49b658f

Browse files
Align empty date/time inputs in Safari iOS
1 parent 437579d commit 49b658f

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

packages/@tailwindcss-postcss/src/__snapshots__/index.test.ts.snap

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,9 +509,15 @@ exports[`\`@import 'tailwindcss'\` is replaced with the generated CSS 1`] = `
509509
-webkit-appearance: none;
510510
}
511511
512+
input:where([type="date"], [type="time"], [type="datetime-local"], [type="month"], [type="week"]) {
513+
display: inline-block;
514+
}
515+
512516
::-webkit-date-and-time-value {
517+
vertical-align: middle;
513518
text-align: inherit;
514519
min-height: 1lh;
520+
display: inline-block;
515521
}
516522
517523
::-webkit-datetime-edit {

packages/tailwindcss/preflight.css

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,13 +245,23 @@ progress {
245245
}
246246

247247
/*
248-
1. Ensure date/time inputs have the same height when empty in iOS Safari.
249-
2. Ensure text alignment can be changed on date/time inputs in iOS Safari.
248+
Ensure the empty date/time inputs are correctly aligned in iOS Safari.
249+
*/
250+
input:where([type="date"], [type="time"], [type="datetime-local"], [type="month"], [type="week"]) {
251+
display: inline-block;
252+
}
253+
254+
/*
255+
1. Ensure the empty date/time inputs are correctly aligned in iOS Safari.
256+
2. Ensure date/time inputs have the same height when empty in iOS Safari.
257+
3. Ensure text alignment can be changed on date/time inputs in iOS Safari.
250258
*/
251259

252260
::-webkit-date-and-time-value {
253-
min-height: 1lh; /* 1 */
254-
text-align: inherit; /* 2 */
261+
vertical-align: middle; /* 1 */
262+
min-height: 1lh; /* 2 */
263+
text-align: inherit; /* 3 */
264+
display: inline-block; /* 1 */
255265
}
256266

257267
/*

0 commit comments

Comments
 (0)