function getHeightRate() {
  const { clientHeight } = document.documentElement;
  return clientHeight / 1080;
}

function setRootFontSize() {
  document.documentElement.style.fontSize = `${getHeightRate() * 18}px`;
}

setRootFontSize();

window.addEventListener("resize", setRootFontSize);

export {
  // eslint-disable-next-line import/prefer-default-export
  getHeightRate,
};
