You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/layout/dynamic-font-scaling.md
+4-30Lines changed: 4 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,6 @@
2
2
3
3
Dynamic Font Scaling is a feature that allows users to choose the size of the text displayed on the screen. This helps users who need larger text for better readability, and it also accommodates users who can read smaller text.
4
4
5
-
Dynamic Font Scaling is supported on Android, iOS, and iPadOS starting in Ionic v7.5.
6
-
7
5
## Try It Out
8
6
9
7
:::tip
@@ -18,35 +16,11 @@ import DynamicFontScaling from '@site/static/usage/v8/layout/dynamic-font-scalin
18
16
19
17
<DynamicFontScaling />
20
18
21
-
## Enabling Dynamic Font Scaling in Ionic
22
-
23
-
:::info
24
-
This feature is currently opt-in on iOS. However, it will be enabled by default starting in Ionic 8 at which point the following CSS will no longer be necessary.
25
-
:::
26
-
27
-
Dynamic Font Scaling is already enabled by default on Android. Developers can enable it on iOS using the following steps:
28
-
29
-
1. Ensure that the [typography.css](/docs/layout/global-stylesheets#typographycss) file is imported.
Under the hood, Ionic sets the following CSS on iOS devices to enable Dynamic Font Scaling:
40
-
41
-
```css
42
-
html {
43
-
font: var(--ion-dynamic-font);
44
-
}
45
-
```
19
+
## Using Dynamic Font Scaling
46
20
47
-
:::
21
+
### Enabling in an Application
48
22
49
-
## Using Dynamic Font Scaling
23
+
Dynamic Font Scaling is enabled by default as long as the [typography.css](/docs/layout/global-stylesheets#typographycss) file is imported. Importing this file will define the `--ion-dynamic-font` variable which will activate Dynamic Font Scaling. While not recommended, developers can opt-out of Dynamic Font Scaling by setting this variable to `initial` in their application code.
50
24
51
25
### Integrating Custom Components
52
26
@@ -192,7 +166,7 @@ The Chrome Web Browser on Android has some limitations with respecting system-le
192
166
There are a number of reasons why Dynamic Font Scaling may not have any effect on an app. The following list, while not exhaustive, provides some things to check to debug why Dynamic Font Scaling is not working.
193
167
194
168
1. Verify that your version of Ionic supports Dynamic Font Scaling. Dynamic Font Scaling was added starting in Ionic v7.5.
195
-
2.Dynamic Font Scaling is opt-in on iOS in Ionic 7. Verify that the proper CSS has been set. See [Enabling Dynamic Font Scaling in Ionic](#enabling-dynamic-font-scaling-in-ionic) for more information.
169
+
2. Verify that the [typography.css](/docs/layout/global-stylesheets#typographycss) file has been imported. This file is required for Dynamic Font Scaling to work.
196
170
3. Verify that your code does not override the root element's default font size. Manually setting a font size on the root element will prevent Dynamic Font Scaling from working as intended.
197
171
4. Verify that your code does not override font sizes on Ionic components. Ionic components that set `font-size` rules will use `rem` units. However, if your app overrides that to use `px`, then that custom rule will need to be converted to use `rem`. See [Integrating Custom Components](#integrating-custom-components) for more information.
198
172
5. Verify "Accessibility Page Zoom" is enabled if using Chrome for Android. See [Chrome for Android](#chrome-for-android) for more information.
0 commit comments