Just the standard way:
- Get the computed styles with getComputedStyle
- Use getPropertyValue to get the value of the desired property
getComputedStyle(element).getPropertyValue('--color-font-general');
Example:
var style = getComputedStyle(document.body);
console.log(style.getPropertyValue('--color-font-general'));
:root { --color-font-general: #336699; }