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.
12 lines
314 B
JavaScript
12 lines
314 B
JavaScript
let element = document.body || document.documentElement;
|
|
let e = document.createElement('div');
|
|
e.style.cssText = 'width:10px;padding:2px;box-sizing:border-box;';
|
|
element.appendChild(e);
|
|
|
|
let width = window.getComputedStyle(e, null).width;
|
|
let ret = width === '10px';
|
|
|
|
element.removeChild(e);
|
|
|
|
export default ret;
|