the code to determine hasScrollbarGutter can run while the document.body is not loaded yet. setting it as a function will trigger it when the actual UI is loaded, and document.body should exist.