Get or Set CSS Variable
<p>Does jQuery have a way to get and set the value of CSS variables? (<a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_variables" rel="nofollow">MDN - Using CSS variables</a>)</p>

<p>I have tried using the normal css function <code>$(".element").css("--varname", 1)</code>, but it doesn't work.</p>

<p>I can use normal DOM functions, but I would prefer not to mix that and jQuery:</p>

<pre><code>element.style.getPropertyValue("--varname");
element.style.setProperty("--varname", value);
</code></pre>

<p>I am using this variable in a <code>transform</code>, so getting the result of using the variable gives a <code>matrix3d()</code> string. I need to get the value for some calculations in JS</p>