<html>
<head>
<style>
:root {
  --main-color: #c06;
  --accent-background: linear-gradient(to top, var(--main-color), white);
}
</style>
<body>
<script>
document.body.offsetTop
document.write(getComputedStyle(document.documentElement).getPropertyValue("--accent-background") + "<br>")
document.documentElement.setAttribute("style", "--main-color:green")
document.write(getComputedStyle(document.documentElement).getPropertyValue("--accent-background"))
</script>
</body>
</html>
