You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Vestride_Shuffle/src/computed-size.js

18 lines
396 B
JavaScript

let value = null;
export default () => {
if (value !== null) {
return value;
}
const element = document.body || document.documentElement;
const e = document.createElement('div');
e.style.cssText = 'width:10px;padding:2px;box-sizing:border-box;';
element.appendChild(e);
value = window.getComputedStyle(e, null).width === '10px';
element.removeChild(e);
return value;
};