Repository navigation
feat: add dynamic type variables - #27745
Conversation
|
|
| @supports (-webkit-touch-callout: none) { | ||
| html { | ||
| font: var(--ion-dynamic-type); | ||
| } | ||
| } |
There was a problem hiding this comment.
macOS now has Dynamic Type support. However, the base font size on macOS is 13px. While this aligns with the rest of the macOS design system, it does not align with Ionic components which are designed for mobile. As a result, enabling this on macOS would cause fonts to appear too small on desktop. As a result, the dynamic type font is only applied on iOS. -webkit-touch-callout detects WebKit + iOS support.
|
Brandy noted that I never actually provided how to test this. There are two ways:
setting.mp4
cc.mp4 |
There was a problem hiding this comment.
This looks good! I was running into an issue because I tried changing the h1 font-size in typography.scss to use rem units but it needed a full re-build to see the changes.
I tested it out using the src/components/text/test/basic test.
Issue number: N/A
What is the current behavior?
Developers have no way of opting in to using Dynamic Type on iOS.
What is the new behavior?
fontto--ion-dynamic-type. This variable is unset initially to not cause unexpected breakages in applications. Developers must opt-in to using Dynamic Type with the following CSS:This will be enabled by default in an upcoming major release of Ionic.
Does this introduce a breaking change?
Other information