Created
July 23, 2018 16:15
-
-
Save ArthurYidi/17b4ca2c0f8c48e890d2f66b01588b4c to your computer and use it in GitHub Desktop.
Detect Dynamic Font Size Changed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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