{"name":"dom-css","version":"1.1.2","description":"fast dom CSS styling","main":"index.js","license":"MIT","author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com","url":"https://github.com/mattdesl"},"dependencies":{"prefix-style":"^1.0.0","to-camel-case":"^0.2.1"},"devDependencies":{"beefy":"^2.1.1","browserify":"^8.1.1","smokestack":"^3.2.0","tap-closer":"^1.0.0","tap-spec":"^2.1.2","tape":"^3.2.0"},"scripts":{"test":"browserify test.js | tap-closer | smokestack | tap-spec"},"keywords":["dom","css","style","sheet","animate","element","px","pixels"],"repository":{"type":"git","url":"git://github.com/mattdesl/dom-css.git"},"homepage":"https://github.com/mattdesl/dom-css","bugs":{"url":"https://github.com/mattdesl/dom-css/issues"},"gitHead":"6daf9d8f4151f1a2d2c3ede8d204c7de282b10e4","_id":"dom-css@1.1.2","_shasum":"22b8bd77ce709e4c20ba58ee0a2c3df27fe64ba9","_from":".","_npmVersion":"2.1.18","_nodeVersion":"0.10.32","_npmUser":{"name":"mattdesl","email":"dave.des@gmail.com"},"dist":{"shasum":"22b8bd77ce709e4c20ba58ee0a2c3df27fe64ba9","tarball":"http://registry-npm.ywwl.com/dom-css/download/dom-css-1.1.2.tgz","integrity":"sha512-/olHOzeC9iMjaF0UtXJmTqkh35RPSo9DLIHLiIDx2+RjHM3U4f42FVBuYdCsiJhs/Hn1hr4tI8QKltqMFWiKQQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDmgm925SMj5nKdbsubAFfD1aKjMBsU1BQh/XlKJrmdhgIhALErf1byQmVfjqhO/PYUYawPw1oNYb/aPQ3/xzxMEvrK"}],"size":2903,"noattachment":false,"key":"/dom-css/-/dom-css-1.1.2.tgz"},"maintainers":[{"name":"mattdesl","email":"dave.des@gmail.com"}],"directories":{},"readme":"# dom-css\n\n[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)\n\nSmall module for fast and reliable DOM styling. \n\n- normalizes for camel and dash case (see [to-camel-case](https://www.npmjs.com/package/to-camel-case))\n- detects vendor prefixes as necessary, cached for performance (see [prefix-style](https://github.com/mattdesl/prefix-style))\n- converts numbers to `px` strings for common properties (see [add-px-to-style](https://www.npmjs.com/package/add-px-to-style))\n\n```js\nvar css = require('dom-css')\n\n//set a style\ncss(element, 'position', 'absolute')\n\n//will be set as \"WebkitFontSmoothing\" on Chrome\ncss(element, 'font-smoothing', 'none')\n\n//set multiple styles\ncss(element, {\n  // can be camel or dash case\n  'background-color': 'blue',\n\n  // you can use numbers to auto-\"px\"\n  left: 25, \n  top: 0,\n  marginTop: 0,\n  position: 'absolute',\n  \n  // certain props will not have \"px\" added\n  opacity: 0.5\n})\n\n//get the current style\ncss.get(element, 'position') \n// -> 'absolute'\n\ncss.get(element, ['left', 'marginTop']) \n// -> { left: '25px', marginTop: '0px' }\n``` \n\n**Note:** The `get()` method does not *compute* an element's style, it only fetches the currently set inline style.\n\n## Usage\n\n[![NPM](https://nodei.co/npm/dom-css.png)](https://nodei.co/npm/dom-css/)\n\n#### `css(element, property, value)`\n#### `css.set(element, property, value)`\n\nStyles an element with the css `property` (dash or camel case) and a given value. `value` is a string, or a number to be suffixed with `'px'` (special cases, see below). \n\n#### `css(element, styles)`\n#### `css.set(element, styles)`\n\nA shorthand for setting multiple styles, where `styles` is an object containing `property:value` pairs. \n\n#### `css.get(element, prop)`\n\nGets the inline style of element, where `prop` is a string (like `\"borderRadius\"`) or an array of strings. If an array of strings is given, an object is returned with key-value pairs representing the specified properties.\n\n```js\ncss.get(div, ['width', 'height'])\n//=> { width: '20px', height: '40px' }\n```\n\nThis does not provide the *computed* style, only the current inline style.\n\n#### auto px\n\nIf a number is specified, the value will have `\"px\"` added to it, *unless* it is a special unitless property like `'opacity'` and `'zIndex'`. See the full list in [add-px-to-style](https://www.npmjs.com/package/add-px-to-style) (sourced from React).\n\n## Changelog\n\n- `2.x`\n  - formatted to [standard](https://npmjs.com/package/standard) code style\n  - updates to latest `prefix-style`, since `'Khtml'` prefix has long been obsolete\n  - now all properties are suffixed with \"px\" except a few like `opacity`, `zIndex`, etc. The list is sourced from React and maintained in another module.\n- `1.x` - initial version which had a list of properties to be suffixed with \"px\"\n\n## License\n\nSpecial thanks to Paul Irish's gist for the prefix detection (now part of Modernizr). \n\nMIT, see [LICENSE.md](http://github.com/mattdesl/dom-css/blob/master/LICENSE.md) for details.\n","publish_time":1436296230951,"_cnpm_publish_time":1436296230951,"dist-tags":{"latest":"2.1.0"}}