It may be less elegant, but more reliable, for listening to a full-screen event, and then, possibly, add the is-fullscreen class to the body so that you can write your rule as follows:
body.is-fullscreen .content { padding...
For instance:
document.addEventListener('fullscreenchange', function() { document.body.classList.toggle('is-fullscreen', document.fullscreenEnabled); });
This event has vendor prefix versions, so make sure you use the one you need.
user663031
source share