domcss.js
Compute CSS properties and position of DOM elements.
Developed by Florian Eckerstorfer (@Florian_) in Vienna, Europe.
Installation
You can install domcss.js
from NPM:
$ npm install domcss.js
Usage
If you are interesting in (nearly) every CSS property property:
var domCSS = ;
However, you can also define the properties that domcss.js
should compute:
var domCSS = 'font-family' 'font-size' 'color';
attachToDOM()
Compute CSS and position for all elements in <body>
and attach to DOM:
domCSS;// document.body.children[0].computedPosition -> {"x1": 8, "x2": 138.671875, "y1": 0, "y2": 32}// document.body.children[0].computedCSSProperties -> {"color": "rgb(0, 0, 238)", ...}
computeStyles()
Compute CSS properties for a specific element:
domCSS;// -> {"color": "rgb(0, 0, 238)", "font-family": "Times", "font-size": "32px", ...}
computeStyle()
Compute specific CSS property
domCSS;// -> "32px"
computePosition()
Compute position for a specific element:
domCSS;// -> {"x1": 8, "x2": 138.671875, "y1": 0, "y2": 32}