Skip to content

Commit c1c4286

Browse files
authored
Fix date time bottom spacing on MacOS Safari (#146)
* Fix date time bottom spacing on Safari * Update changelog
1 parent d74d454 commit c1c4286

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

CHANGELOG.md

+3-1
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+
- Fix date time bottom spacing on MacOS Safari ([#146](https://github.com/tailwindlabs/tailwindcss-forms/pull/146))
1113

1214
## [0.5.5] - 2023-08-22
1315

src/index.js

+11
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,17 @@ const forms = plugin.withOptions(function (options = { strategy: undefined }) {
106106
'text-align': 'inherit',
107107
},
108108
},
109+
{
110+
// In Safari on macOS date time inputs that are set to `display: block` have unexpected
111+
// extra bottom spacing. This can be corrected by setting the `::-webkit-datetime-edit`
112+
// pseudo-element to `display: inline-flex`, instead of the browser default of
113+
// `display: inline-block`.
114+
base: ['::-webkit-datetime-edit'],
115+
class: ['.form-input::-webkit-datetime-edit'],
116+
styles: {
117+
display: 'inline-flex',
118+
},
119+
},
109120
{
110121
// In Safari on macOS date time inputs are 4px taller than normal inputs
111122
// This is because there is extra padding on the datetime-edit and datetime-edit-{part}-field pseudo elements

0 commit comments

Comments
 (0)