JSFiddle - React, Tailwind, and code Playground

CSS

:root {
	--test: #000;
}

JavaScript

let cs = window.getComputedStyle(document.documentElement);
// works
console.log(cs.getPropertyValue('--test'));

// doesn't work in Chrome
for (let i of cs) {
	if (i.indexOf('--') == 0) {
		console.log(i);
	}
}