smart-core-util
Version:
smartx javascript utils
11 lines • 413 B
JavaScript
class iRem {
constructor() {}
static install(doc, win) {
var docEl = doc.documentElement,
isPad = (docEl.clientWidth || window.innerWidth) >= 768;
var clientWidth = docEl.clientWidth;
if (!clientWidth) return;
isPad ? docEl.style.fontSize = 100 * (clientWidth / 768) + 'px' : docEl.style.fontSize = 100 * (clientWidth / 375) + 'px';
}
}
export default iRem;