{"name":"css-to-react-native","version":"2.3.2","description":"Convert CSS text to a React Native stylesheet object","main":"index.js","scripts":{"build":"rollup ./src/index.js -o index.js --f cjs && babel index.js -o index.js","test":"jest","test:watch":"jest --watch","lint":"eslint src","prepublish":"npm run build","precommit":"lint-staged","lint-staged":"lint-staged"},"repository":{"type":"git","url":"git+https://github.com/styled-components/css-to-react-native.git"},"keywords":["styled-components","React","ReactNative","styles","CSS"],"author":{"name":"Jacob Parker"},"license":"MIT","bugs":{"url":"https://github.com/styled-components/css-to-react-native/issues"},"homepage":"https://github.com/styled-components/css-to-react-native#readme","jest":{"testURL":"http://localhost"},"devDependencies":{"babel-cli":"^6.26.0","babel-preset-es2015":"^6.24.1","eslint":"^4.17.0","eslint-config-airbnb-base":"^12.1.0","eslint-config-prettier":"^2.9.0","eslint-plugin-import":"^2.8.0","eslint-plugin-prettier":"^2.6.0","jest":"^22.2.2","lint-staged":"^6.1.0","prettier":"^1.10.2","rollup":"^0.55.5"},"dependencies":{"camelize":"^1.0.0","css-color-keywords":"^1.0.0","postcss-value-parser":"^3.3.0"},"lint-staged":{"*.js":["eslint --fix","git add"]},"gitHead":"6dce838f0a2265f2616a610bee3ef0a31eb12e52","_id":"css-to-react-native@2.3.2","_npmVersion":"6.4.1","_nodeVersion":"8.16.0","_npmUser":{"name":"kristerkari","email":"krister@sent.at"},"dist":{"integrity":"sha512-VOFaeZA053BqvvvqIA8c9n0+9vFppVBAHCp6JgFTtTMU3Mzi+XnelJ9XC9ul3BqFzZyQ5N+H0SnwsWT2Ebchxw==","shasum":"e75e2f8f7aa385b4c3611c52b074b70a002f2e7d","tarball":"http://registry-npm.ywwl.com/css-to-react-native/download/css-to-react-native-2.3.2.tgz","fileCount":37,"unpackedSize":85346,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdYt+9CRA9TVsSAnZWagAARHAQAJGXfD2GpgltMcBt5Q+k\nCZpv7Ikh20CVwu07vi+YIHWwb4AfGlWgHGxl2nkc/Z6RkQjfHTxMb/LuSbqd\nYfmXAVqeUWyy3kflPCzicQzDox42m9RMOwuimajVEZTVWP7TZ7u6vDPm7Voh\n+H1dgleJ9kqTnuN+TaOFzIptsYNlc+GaT4wjaRmnssPzvAMdR6XA5al9CiR9\ntyNaQ8whfn37DXCXydWq9aBgIooazuWZ/TVyxdAnP53FNssmju0KXiZrZlZt\n77XwkfPecCm0Cx0BntmPrbaQ7m04pfuaHJyRcqppKH1kFkYjC/8gtnuOEP3y\nMQGQSIRsZeuoPR+8EX/l76gb6nUvKVmZIbmxvCBfsUW8RCL5gn5LRcgYf9HK\nKfdXD0RZaf/UB+6bldHD01hnnNkECgJ9OG3e7h4spbbd9YCD/5CNu0tzwFeh\nSQ+Lt24dvxq/R3mbrwRnBH0V3wa90tNVLJq6lCgIoHBjKESg7nf/fJ9eVTY3\nJspQQaQeRVcO2GkzzjT8pXhB2/QdjqsAeAS2i9oMOlbZWVhtoKhMnETYfnea\nQR10T/oktDgUtL8odhBotXH+zgH1Gh6t/Z0vuNC/q80fDLuYLjaNssbat2Fm\nqAoGkZNZ83MMxqTaG6gZ8Mlteh1YHVIPZLfUh224dDIGqDLDjpJbHYEKOA1F\n2OZL\r\n=qJ92\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDxnQdqAWJz9Hs81zVPChB6xSgWf2la8c2DalyUZakbEgIgOx6j182aMaVb1vkqZk4JirAr0sJ654QNudMSzG4WRqA="}],"size":19060,"noattachment":false,"key":"/css-to-react-native/-/css-to-react-native-2.3.2.tgz"},"maintainers":[{"email":"jacobparker1992@gmail.com","name":"jacobp100"},{"email":"krister@sent.at","name":"kristerkari"},{"email":"npm@mxstbr.com","name":"mxstbr"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/css-to-react-native_2.3.2_1566760893157_0.5047349337742673"},"_hasShrinkwrap":false,"readme":"# css-to-react-native\n\nConverts CSS text to a React Native stylesheet object.\n\n[Try it here](https://csstox.surge.sh)\n\n```css\nfont-size: 18px;\nline-height: 24px;\ncolor: red;\n```\n\n```js\n{\n  fontSize: 18,\n  lineHeight: 24,\n  color: 'red',\n}\n```\n\nConverts all number-like values to numbers, and string-like to strings.\n\nAutomatically converts indirect values to their React Native equivalents.\n\n```css\ntext-shadow-offset: 10px 5px;\nfont-variant: small-caps;\ntransform: translate(10px, 5px) scale(5);\n```\n\n```js\n{\n  textShadowOffset: { width: 10, height: 5 },\n  fontVariant: ['small-caps'],\n  // Fixes backwards transform order\n  transform: [\n    { translateY: 5 },\n    { translateX: 10 },\n    { scale: 5 },\n  ]\n}\n```\n\nAlso allows shorthand values.\n\n```css\nfont: bold 14px/16px \"Helvetica\";\nmargin: 5px 7px 2px;\n```\n\n```js\n{\n  fontFamily: 'Helvetica',\n  fontSize: 14,\n  fontWeight: 'bold',\n  fontStyle: 'normal',\n  fontVariant: [],\n  lineHeight: 16,\n  marginTop: 5,\n  marginRight: 7,\n  marginBottom: 2,\n  marginLeft: 7,\n}\n```\n\nShorthands will only accept values that are supported in React, so `background` will only accept a colour, `backgroundColor`\n\nThere is also support for the `box-shadow` shorthand, and this converts into `shadow-` properties. Note that these only work on iOS.\n\n#### Shorthand Notes\n\n`border{Top,Right,Bottom,Left}` shorthands are not supported, because `borderStyle` cannot be applied to individual border sides.\n\n# API\n\nThe API is mostly for implementors. However, the main API may be useful for non-implementors. The main API is an array of `[property, value]` tuples.\n\n```js\nimport transform from 'css-to-react-native';\n// or const transform = require('css-to-react-native').default;\n\ntransform([\n  ['font', 'bold 14px/16px \"Helvetica\"'],\n  ['margin', '5px 7px 2px'],\n  ['border-left-width', '5px'],\n]); // => { fontFamily: 'Helvetica', ... }\n```\n\nWe don't provide a way to get these style tuples in this library, so you'll need to do that yourself. I expect most people will use postCSS or another CSS parser. You should try avoid getting these with `string.split`, as that has a lot of edge cases (colons and semi-colons appearing in comments etc.)\n\nFor implementors, there is also a few extra APIs available.\n\nThese are for specific use-cases, and most people should just be using the API above.\n\n```js\nimport { getPropertyName, getStylesForProperty } from 'css-to-react-native';\n\ngetPropertyName('border-width'); // => 'borderWidth'\ngetStylesForProperty('borderWidth', '1px 0px 2px 0px'); // => { borderTopWidth: 1, ... }\n```\n\nShould you wish to opt-out of transforming certain shorthands, an array of property names in camelCase can be passed as a second argument to `transform`.\n\n```js\ntransform([['border-radius', '50px']], ['borderRadius']);\n// { borderRadius: 50 } rather than { borderTopLeft: ... }\n```\n\nThis can also be done by passing a third argument, `false` to `getStylesForProperty`.\n\n## License\n\nLicensed under the MIT License, Copyright © 2019 Krister Kari, Jacob Parker, and Maximilian Stoiber.\n\nSee [LICENSE.md](./LICENSE.md) for more information.\n","publish_time":1566760893258,"_cnpm_publish_time":1566760893258,"dist-tags":{"latest":"3.2.0"}}