-
Notifications
You must be signed in to change notification settings - Fork 7
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
Set a default minimum font size of 16px for inputs on touch devices #1096
Conversation
Previously the font size for inputs was taken from the `text-sm` default for `body`, which evaluates to 14px. This is below the threshold on iOS that causes the browser to zoom into the field when focused. Fixes #1061 See also https://tailwindcss.com/docs/preflight#extending-preflight
@tailwind components; | ||
@tailwind utilities; | ||
|
||
@layer base { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This follows Tailwind's recommendation for extending base styles: https://tailwindcss.com/docs/preflight#extending-preflight. If there is a reason we shouldn't be doing that, please let me know!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, this is fine and conventional.
input, textarea { | ||
font-size: max(16px, 100%); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we upstream this into the frontend-shared package?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I want to think about that. I've found so far that it's easier to wrangle base styles per-app, as that's where our variation tends to be. Not sure. Perhaps we could track in a separate ticket?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we could track in a separate ticket?
Will do 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻
@tailwind components; | ||
@tailwind utilities; | ||
|
||
@layer base { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, this is fine and conventional.
input, textarea { | ||
font-size: max(16px, 100%); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I want to think about that. I've found so far that it's easier to wrangle base styles per-app, as that's where our variation tends to be. Not sure. Perhaps we could track in a separate ticket?
Previously the font size for inputs was taken from the
text-sm
default forbody
, which evaluates to 14px. This is below the threshold on iOS that causes the browser to zoom into the field when focused.Fixes #1061
See also https://tailwindcss.com/docs/preflight#extending-preflight
Testing:
If testing with the local dev server on an actual mobile device, you will need to edit the
client_embed_url
setting to point to the IP of your dev system, in order for the client to load.