0.0.1 • Published 7 years ago

snapshot-node v0.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

snapshot-node

Build Status

Clone a HTML node & apply computed styles recursively to the cloned node.

Install

npm install snapshot-node --save

Usage

import {snapshotNode} from 'snapshot-node'

const target = document.getElementById('target')
const snapshot = snapshotNode(target)

// target element and its ancestors's computed styles will be saved as inline styles of snapshot's corresponding element.

See test for a more complete example.

Limitations

Only HTMLElement & SVGElements' styles are snapshotted.

License

MIT