"use strict";

var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");

_Object$defineProperty(exports, "__esModule", {
  value: true
});

exports.inch = inch;
exports.cm = cm;
var PPI = getPPI();

function inch() {
  return PPI;
}

function cm() {
  return PPI / 2.54;
} // We use CSS units of `in` and `cm` for print views, but we want the values in
// pixels for the screen. PPI is normally 96, but just in case we measure it
// once on page load.


function getPPI() {
  var div = document.createElement('div');
  div.style.width = '1in';
  div.style.position = 'absolute';
  div.style.visibility = 'hidden';
  document.body.appendChild(div);
  var rect = div.getBoundingClientRect();
  document.body.removeChild(div);
  return rect.width;
}
//# sourceMappingURL=dom.js.map