JSFiddle - React, Tailwind, and code Playground
by brigand
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Select Window Coordinates</title>
<style>
/* Theme settings; modify as you like */
:root {
--background: #444;
--foreground: #fcfcfc;
--background-alt: #444872;
--foreground-alt: #9ad7e9;
--foreground-alt-muted: #a1bdc6;
--font-size: 16px;
--input-scale: 2.2;
/*
our base is 600px wide viewport -> 16px font, so that's a scale of 37.5
*/
--font-scale: 37.5;
--preview-height: calc(100vw * (10 / 16));
}
/*
We'll separate out the responsive typography mess. This just scales
the UI up/down depending on the viewport size
*/
:root {
--rt-min-vw: 0;
--rt-max-vw: 3000;
--rt-min-px: 0;
/*
if we want to scale up to 3000px, max-px needs to be 3000 / 37.5 = 80
*/
--rt-font-size: calc(var(--font-scale) * (100vmax / var(--rt-max-vw)));
}
</style>
<style>
/* Generic CSS Resets */
html, body {
margin: 0;
padding: 0;
box-sizing: border-box;
width: 100%;
height: 100%;
overflow-x: hidden;
overflow-y: visible;
}
input,
button {
margin: 0;
border: 0;
padding: 0;
display: block;
white-space: normal;
background: none;
line-height: 1;
font-size: 1em;
font-family: Arial;
}
* {
color: inherit;
font-size: 1em;
box-sizing: inherit;
font-family: inherit;
}
</style>
<style>
/* Our custom styles */
html, body {
width: 100%;
height: 100%;
background: var(--background);
color: var(--foreground);
font-family: Arial, Helvetica, sans-serif;
}
body {
font-size: var(--rt-font-size);
}
body {
box-shadow: 0 0 0 2px...