Skip to content

Instantly share code, notes, and snippets.

@ArthurYidi
Created July 23, 2018 16:15
Show Gist options
  • Save ArthurYidi/17b4ca2c0f8c48e890d2f66b01588b4c to your computer and use it in GitHub Desktop.
Save ArthurYidi/17b4ca2c0f8c48e890d2f66b01588b4c to your computer and use it in GitHub Desktop.
Detect Dynamic Font Size Changed
document.addEventListener('visibilitychange', function() {
if (document.visibilityState === 'visible') {
document.querySelector(':root').style.font = '-apple-system-body';
let fontSize = getComputedStyle(document.body).getPropertyValue('font-size');
console.log(fontSize);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment