(function flexible(window, document) { var docel = document.documentelement var dpr = window.devicepixelratio || 1 function setbodyfontsize() { if (document.body) { document.body.style.fontsize = (12 * dpr) + 'px' } else { document.addeventlistener('domcontentloaded', setbodyfontsize) } } setbodyfontsize(); function setremunit() { var rem = docel.clientwidth / 10 docel.style.fontsize = rem + 'px' } setremunit() window.addeventlistener('resize', setremunit) window.addeventlistener('pageshow', function (e) { if (e.persisted) { setremunit() } }) if (dpr >= 2) { var fakebody = document.createelement('body') var testelement = document.createelement('div') testelement.style.border = '.5px solid transparent' fakebody.appendchild(testelement) docel.appendchild(fakebody) if (testelement.offsetheight === 1) { docel.classlist.add('hairlines') } docel.removechild(fakebody) } }(window, document))