JSFiddle - React, Tailwind, and code Playground

by Sergii Pravdzivyi

HTML

<html>
<body>
<div></div>
<button onclick="document.querySelector('html').classList.toggle('blue')">
Toggle
</button>
</body>
</html>

CSS

:root {
	--bg: red;
}
:root.blue {
  --bg: blue;
}
div {
  width: 50px;
  height: 50px;
  background: var(--bg);
}