JSFiddle - React, Tailwind, and code Playground
by Dominik Wilk
HTML
<!DOCTYPE html>
<html lang="en" id="html">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<div class="rodzic">
<p>test</p>
</div>
</body>
</html>
SCSS
html {
font-size: 20px;
}
.rodzic {
font-size: 30px;
}
p {
font-size: 2em;
}
JavaScript
document.getElementById("zmien").addEventListener("click", zmien);
var fontSize = 16;
function zmien() {
fontSize += 2;
document.querySelector('#html').style.fontSize = fontSize + "px"
}