mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-02 14:16:39 +01:00
Safe to reuse getComputedStyle
This commit is contained in:
parent
92a87a846d
commit
ddbca53a72
1 changed files with 1 additions and 1 deletions
|
@ -1,10 +1,10 @@
|
||||||
import mem from 'mem';
|
import mem from 'mem';
|
||||||
|
|
||||||
const root = document.documentElement;
|
const root = document.documentElement;
|
||||||
|
const style = getComputedStyle(root);
|
||||||
const defaultBoundingBoxPadding = 8;
|
const defaultBoundingBoxPadding = 8;
|
||||||
function _safeBoundingBoxPadding() {
|
function _safeBoundingBoxPadding() {
|
||||||
// Get safe area inset variables from root
|
// Get safe area inset variables from root
|
||||||
const style = getComputedStyle(root);
|
|
||||||
const safeAreaInsetTop = style.getPropertyValue('--sai-top');
|
const safeAreaInsetTop = style.getPropertyValue('--sai-top');
|
||||||
const safeAreaInsetRight = style.getPropertyValue('--sai-right');
|
const safeAreaInsetRight = style.getPropertyValue('--sai-right');
|
||||||
const safeAreaInsetBottom = style.getPropertyValue('--sai-bottom');
|
const safeAreaInsetBottom = style.getPropertyValue('--sai-bottom');
|
||||||
|
|
Loading…
Reference in a new issue