Skip to content

Date inputs are 4px taller than other inputs in macOS Safari #82

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
morphsteve opened this issue Sep 20, 2021 · 1 comment
Closed

Date inputs are 4px taller than other inputs in macOS Safari #82

morphsteve opened this issue Sep 20, 2021 · 1 comment

Comments

@morphsteve
Copy link

morphsteve commented Sep 20, 2021

What version of @tailwindcss/forms are you using?

0.3.3

What version of Node.js are you using?

v14.17.0

What browser are you using?

Safari 14.1.2

What operating system are you using?

macOS 11.5.2

Reproduction repository

https://github.com/tailwindlabs/tailwindcss-forms

Describe your issue

Date inputs on Safari macOS are around 4px taller than other inputs. This is evident on https://tailwindcss-forms.vercel.app/:

email - 42px

date - 46px

This caused by the UA stylesheet applying padding-top: 1px to input::-webkit-datetime-edit and input::-webkit-datetime-edit-year-field (and month-field, day-field etc).

May relate to #38.

I added the following base styles to my app stylesheet to compensate:

@layer base {
    input::-webkit-datetime-edit,
    input::-webkit-datetime-edit-year-field,
    input::-webkit-datetime-edit-month-field,
    input::-webkit-datetime-edit-day-field,
    input::-webkit-datetime-edit-hour-field,
    input::-webkit-datetime-edit-minute-field,
    input::-webkit-datetime-edit-second-field,
    input::-webkit-datetime-edit-millisecond-field,
    input::-webkit-datetime-edit-meridiem-field {
        padding: 0;
    }
}
@morphsteve morphsteve changed the title Date inputs are 4px taller in macOS Safari Date inputs are 4px taller than other inputs in macOS Safari Sep 20, 2021
@reinink
Copy link
Member

reinink commented Sep 24, 2021

Hey thanks for reporting this @morphsteve. This is the same issue as #38, so I'm going to close this issue in favor of that one. We have been able to able to reproduce this, and hope to eventually get this fixed 👍

@reinink reinink closed this as completed Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants