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
322 B
JavaScript
12 lines
322 B
JavaScript
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);
|
|
|
|
const width = window.getComputedStyle(e, null).width;
|
|
const ret = width === '10px';
|
|
|
|
element.removeChild(e);
|
|
|
|
export default ret;
|