Here is a simple way to access CSS variables from the <script> tag :
<script>
const rootStyles = getComputedStyle(document.documentElement); const neutralColor = rootStyles.getPropertyValue('--color-neutral');