Is there a way to ensure that my website's font size dynamically adjusts for iOS users? For example, if a user changes the font size in their iPhone settings (Settings > General > Accessibility > Larger Text), I want the webpage font size to adapt accordingly.
Currently, I have added font: -apple-system-body
in the html root, and I am using rem
units throughout the website to adjust the font size relative to the html root. However, the default font size of 16px
from -apple-system-body
is too large for my page, so I need to convert it to 10px
. Essentially, I want my html root font size to always be 62.5% of what the system provides.
Right now, I am achieving this with javascript by using:
document.documentElement.style.fontSize = document.documentElement.style.fontSize * 0.625;
I'm curious if there is a CSS-only solution to this issue.