src/weex/viewport.js
function setRootFont (width, viewportWidth, force) {
  const doc = window.document
  const rem = width * 750 / viewportWidth / 10
  if (!doc.documentElement) { return }
  const rootFontSize = doc.documentElement.style.fontSize
  if (!rootFontSize || force) {
    doc.documentElement.style.fontSize = rem + 'px'
  }
  info.rem = rem
  info.rootValue = viewportWidth / 10
}
function setRootFont (width, viewportWidth, force) {
  const doc = window.document
  const rem = width * 750 / viewportWidth / 10
  if (!doc.documentElement) { return }
  const rootFontSize = doc.documentElement.style.fontSize
  if (!rootFontSize || force) {
    doc.documentElement.style.fontSize = rem + 'px'
  }
  info.rem = rem
  info.rootValue = viewportWidth / 10
}
function setRootFont ( width , viewportWidth , force ) { const doc = window . document const rem = width * 750 / viewportWidth / 10 if ( ! doc . documentElement ) { return } const rootFontSize = doc . documentElement . style . fontSize if ( ! rootFontSize || force ) { doc . documentElement . style . fontSize = rem + 'px' } info . rem = rem info . rootValue = viewportWidth / 10 }
set root font-size for rem units. If already been set, just skip this.
set root font - size for rem units . If already been set just skip this .