diff --git a/src/utils/safe-bounding-box-padding.jsx b/src/utils/safe-bounding-box-padding.jsx index ef7a5485..b16b7468 100644 --- a/src/utils/safe-bounding-box-padding.jsx +++ b/src/utils/safe-bounding-box-padding.jsx @@ -1,10 +1,10 @@ import mem from 'mem'; const root = document.documentElement; +const style = getComputedStyle(root); const defaultBoundingBoxPadding = 8; function _safeBoundingBoxPadding() { // Get safe area inset variables from root - const style = getComputedStyle(root); const safeAreaInsetTop = style.getPropertyValue('--sai-top'); const safeAreaInsetRight = style.getPropertyValue('--sai-right'); const safeAreaInsetBottom = style.getPropertyValue('--sai-bottom');