Safe to reuse getComputedStyle

This commit is contained in:
Lim Chee Aun 2023-06-14 11:15:40 +08:00
parent 92a87a846d
commit ddbca53a72

View file

@ -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');