Skip to content

Instantly share code, notes, and snippets.

@ArthurYidi
Created July 23, 2018 16:15
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