css-transformer

0.0.2 • Public • Published

css-transformer

JavaScript library tool to hanlde css3 transform property.

Install

$ npm install css-transformer

How to use

<div id="my-element" style="transform: translate(100px) rotate(20deg);">
  Nice transform!
</div>
var transform = require('css-transfomer');
 
var el = document.getElementById('my-element');
 
// get current transform properties from the given element
var prps = transform(el);
 
// set translate property
prps.translate(200);
transform(el, prps);
<div id="my-element" style="transform: translate(200px) rotate(20deg);">
  Nice transform!
</div>

API

Transform(Element)

Return the transform properties object from the given element

Transform.build(Object)

Return the transform style string from the given transform object

Transform.set(Element, Object)

Set transform property in the given element from the given transform object

License

MIT – Copyright 2014 Automattic

Readme

Keywords

none

Package Sidebar

Install

npm i css-transformer

Weekly Downloads

3

Version

0.0.2

License

none

Last publish

Collaborators

  • retrofox