JSFiddle - React, Tailwind, and code Playground

HTML

<div class="pdd" id="test">

</div>

CSS

.pdd {
  margin-left: var(--m);
  margin-top: var(--m);
  width: 100px;
  height: 100px;
  background-color: green;
}

JavaScript

var test = document.getElementById("test");
test.style.setProperty("--m", "20px", "");