sajad torkamani

Assuming you want to get the value of a variable named primary, you can do this:

window.getComputedStyle(document.body).getPropertyValue('--primary')

It’ll return an empty string if the variable doesn’t exist.