-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Support iOS dynamic type for all screen sizes #11934
Conversation
Co-authored-by: David Cortes <[email protected]>
11e2e37
to
8f09d87
Compare
html { | ||
font: -apple-system-body; | ||
} | ||
@supports (font: -apple-system-body) and (-webkit-touch-callout: none) { |
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.
I'll test to confirm it but I think all browsers on iOS use Safari under the hood.
That is also the case for the webviews in the app.
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.
Oh fascinating! And sounds good!
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.
It's very new, and only available in the EU, but Apple has apparently opened the app store to non apple webkit browsers as of 17.4
html { | ||
font: -apple-system-body; | ||
} | ||
@supports (font: -apple-system-body) and (-webkit-touch-callout: none) { |
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.
Presumably this would also target iPad devices?
Some of the bigger iPads can go up to 2732x2048, which is quite a lot higher than the sm
breakpoint of 490px (even accounting for @2x resolution scale) - is it intended to also use font: -apple-system-body
on those larger devices?
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.
@jesstelford yes, the intention is to target iPads as well here. Based on my understanding on font: -apple-system-body
, we do want this even for large screen set at the "root" level. This should apply the system's default body text style.
Curious to test this assumption— do different devices (iPhone/iPad) or screen resolutions make adjustment for the system text styles (caption, body, etc)?
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.
do different devices (iPhone/iPad) or screen resolutions make adjustment for the system text styles (caption, body, etc)?
A good question that I'm not sure about. The effects of font: -apple-system-body
seem to be poorly documented unfortunately.
Might be safe to assume it works the same across all devices, and if we're happy this change will effect iPads, then let's
This PR replaces the
@media
with a@supports
rule to enable dynamic type for iOS devices larger than mobile (e.g., iPad).See
-webkit-touch-callout
MDN docsRelated to @davebcn87's comment here