JSFiddle - React, Tailwind, and code Playground
CSS
body { background-color:lime }
JavaScript
function getBackground(){
var getBody = document.getElementsByTagName("body")[0]
var prop = window.getComputedStyle(getBody).getPropertyValue("background-color");
if(prop === "transparent"){
//console.log("No background colour set")
alert("No background colour set")
} else {
//console.log(prop);
alert(prop)
}
}
getBackground();