Safe to reuse getComputedStyle

pull/165/head^2
Lim Chee Aun 2023-06-14 11:15:40 +08:00
rodzic 92a87a846d
commit ddbca53a72
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

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