JSFiddle - React, Tailwind, and code Playground

by Jagi

HTML

<div></div>
<span></span>

CSS

div {
    width: 10rem; height: 10rem;
    background-color: black;
}

span {
    display: block;
    width: 1cm; height: 1cm;
    background-color: red;
}

JavaScript

document.getElementsByTagName('html')[0].style.fontSize = window.devicePixelRatio * 16 + 'px';