Skip to content
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

Merged
merged 1 commit into from
Jul 20, 2023

Conversation

robertknight
Copy link
Member

@robertknight robertknight commented Jul 19, 2023

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

Testing:

  1. Open a video
  2. Toggle the mobile device mode in the Chrome devtools toolbar. The search input should be 16px when in mobile mode and 14px otherwise

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.

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 {
Copy link
Member Author

@robertknight robertknight Jul 19, 2023

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!

Copy link
Contributor

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%);
}
}
Copy link
Member Author

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?

Copy link
Contributor

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?

Copy link
Member Author

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 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@lyzadanger lyzadanger left a 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 {
Copy link
Contributor

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%);
}
}
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Increase text size of transcript search field to prevent zoom on iOS
2 participants