Selector API - Root

1 - About

The :root tree pseudo-element selects the Root of all blocks in the page

If the document is an HTML document, the root is the HTML element

3 - Example


:root {    
    color: #004085;
    background-color: #cce5ff;
    border-color: #b8daff;
};


Voila

4 - Get all property of the HTML root element

HTML root element


var element = document.querySelector("html");
var style = window.getComputedStyle(element);
for (var prop in style) {
    let value=style.getPropertyValue(prop);
    if (value!=""){
        console.log(prop+":"+value);
    }
}


Data Science
Data Analysis
Statistics
Data Science
Linear Algebra Mathematics
Trigonometry

Powered by ComboStrap