1.0.2 • Published 7 years ago

css-translate-matrix-parser v1.0.2

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

css-translate-matrix-parser

Let's you get the matrix value from a element CSS translate property.

This is an ES6 port from iranreyes's 2d-css-matrix-parse. I also remove it's dependency from get-style-property by using window.getComputedStyle function.

Install

npm install --save css-translate-matrix-parser

Usage

import CSSParser from 'css-translate-matrix-parser';
// You can user css-translate-matrix-parser by passing it the element
let matrixValues = CSSParser.fromElement(document.querySelector('#element'));

// Or by passing the transform value
const styles = window.getComputedStyle(document.querySelector('#element'));
let matrixValues = CSSParser.parse(styles.transform);