{"name":"to-style","version":"1.0.2","description":"Convert style objects to style strings","main":"index.js","scripts":{"build":"browserify --standalone toStyle index.js -o dist/toStyle.js","test":"make test","test-w":"make test-w","test-debug":"mocha --debug-brk --require should"},"repository":{"type":"git","url":"git://github.com/radubrehar/toStyle.git"},"dependencies":{"ustring":"^1.1.0"},"devDependencies":{"should":"~4.0.4","mocha":"~1.20.1"},"author":{"name":"Radu Brehar"},"license":"MIT","bugs":{"url":"https://github.com/radubrehar/toStyle/issues"},"keywords":["style","css","object","conver","style","to","string"],"_id":"to-style@1.0.2","dist":{"shasum":"75825d5c2e86650173251c0bd8ada3874924c49e","tarball":"http://registry-npm.ywwl.com/to-style/download/to-style-1.0.2.tgz","integrity":"sha512-ymhdJBFr8XQXW7sIrWuBN+Id2S2v2JWs9LK1ANLhia6rNLzPgxxaBXu8OcPyPt3a+TrYI7szm3XWBQ863GZGmw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD7zCsgzJPeisYkbiuU7rsyjop8XC/fu5kakK0WKG78FwIhAPP0QXEPsDiTGrBbVEEiLxYeT+v8E6uB9D+LcT7+ysYx"}],"size":7234,"noattachment":false,"key":"/to-style/-/to-style-1.0.2.tgz"},"_from":".","_npmVersion":"1.3.6","_npmUser":{"name":"radubrehar","email":"radu@evanghelic.ro"},"maintainers":[{"name":"radubrehar","email":"radu@evanghelic.ro"}],"directories":{},"readme":"toStyle\n=======\n\nConverts style objects to strings. Can be used on node or in the browser.\n\n## Install\n\n```npm install to-style```\n\n## Usage\n\n```js\nvar toStyleString = require('to-style').string\nvar toStyleObject = require('to-style').object\n```\n\n### toStyleString\n\n```js\ntoStyleString({\n    border: {\n        width: 1,\n        color: 'red'\n    },\n    padding: 4,\n    margin: {\n        top: 5\n    }\n}) == 'border-width: 1px; border-color: red; padding: 4px; margin-top: 5px;'\n```\n\n### toStyleObject\n```js\n\ntoStyleObject({\n    padding: {\n        top: 3,\n        bottom: 2\n    },\n    border: '1px solid red',\n    margin: 4\n}) // =>\n/*\n{\n    'padding-top': '3px',\n    'padding-bottom': '2px',\n    'border': '1px solid red',\n    'margin': '4px'\n}\n */\n```\n\nYou can also get your styles in camel-case, just pass a config object as a second argument to ```toStyleObject```, with ```camelize: true```\n\nExample:\n\n```js\ntoStyleObject({\n    padding: {\n        top: 10\n    },\n    'border-width': 20\n}, { camelize: true})\n\n/**\n *  {\n *      paddingTop: '10px',\n *      borderWidth: '20px'\n *  }\n */\n```\n\n## Usage in browser\n\nIn browser, make sure you add ```dist/toStyle.js``` to your page. This exposes a global ```toStyle``` variable.\n\n```js\nvar toStyleString = toStyle.string\nvar toStyleObject = toStyle.object\n\n```","publish_time":1407329951441,"_cnpm_publish_time":1407329951441,"dist-tags":{"latest":"1.3.3"}}