Minimize call to the dom for screen dimensions.