Skip to content

Commit 50d7355

Browse files
authored
Don't reset horizontal padding on date/time pseudo-elements (#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 7da9272 commit 50d7355

File tree

3 files changed

+25
-17
lines changed

3 files changed

+25
-17
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10-
- Nothing yet!
10+
### Fixed
11+
12+
- Don't reset horizontal padding on date/time pseudo-elements ([#14959](https://github.com/tailwindlabs/tailwindcss/pull/14959))
1113

1214
## [4.0.0-alpha.32] - 2024-11-11
1315

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -518,44 +518,44 @@ exports[`\`@import 'tailwindcss'\` is replaced with the generated CSS 1`] = `
518518
display: inline-flex;
519519
}
520520
521-
::-webkit-datetime-edit {
521+
::-webkit-datetime-edit-fields-wrapper {
522522
padding: 0;
523523
}
524524
525+
::-webkit-datetime-edit {
526+
padding-block: 0;
527+
}
528+
525529
::-webkit-datetime-edit-year-field {
526-
padding: 0;
530+
padding-block: 0;
527531
}
528532
529533
::-webkit-datetime-edit-month-field {
530-
padding: 0;
534+
padding-block: 0;
531535
}
532536
533537
::-webkit-datetime-edit-day-field {
534-
padding: 0;
538+
padding-block: 0;
535539
}
536540
537541
::-webkit-datetime-edit-hour-field {
538-
padding: 0;
542+
padding-block: 0;
539543
}
540544
541545
::-webkit-datetime-edit-minute-field {
542-
padding: 0;
546+
padding-block: 0;
543547
}
544548
545549
::-webkit-datetime-edit-second-field {
546-
padding: 0;
550+
padding-block: 0;
547551
}
548552
549553
::-webkit-datetime-edit-millisecond-field {
550-
padding: 0;
554+
padding-block: 0;
551555
}
552556
553557
::-webkit-datetime-edit-meridiem-field {
554-
padding: 0;
555-
}
556-
557-
::-webkit-datetime-edit-fields-wrapper {
558-
padding: 0;
558+
padding-block: 0;
559559
}
560560
561561
summary {

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)