computed-style
Get the computed styles of a DOM element in a cross browser consistent manner
Install
npm install computed-styles
Usage
Get computed styles
import computedStyles from 'computed-styles';
computedStyles(document.querySelector('#node'))
Convert computed styles to inline styles
import computedStyles from 'computed-styles';
var node = document.querySelector('#node');
computedStyles(node, node.styles);
Copy computed styles to another element
import computedStyles from 'computed-styles';
var source = document.querySelector('#source');
var target = document.querySelector('#target');
computedStyles(source, target.styles);
See API
License
MIT © J. Harshbarger