{"name":"css-to-react-native","version":"3.2.0","description":"Convert CSS text to a React Native stylesheet object","main":"index.js","types":"index.d.ts","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":"^7.6.2","@babel/preset-env":"^7.6.2","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":"^24.9.0","lint-staged":"^6.1.0","prettier":"^1.18.2","rollup":"^1.22.0"},"dependencies":{"camelize":"^1.0.0","css-color-keywords":"^1.0.0","postcss-value-parser":"^4.0.2"},"lint-staged":{"*.js":["eslint --fix","git add"]},"gitHead":"9b0612094f4af293183824801524ea5400322067","_id":"css-to-react-native@3.2.0","_nodeVersion":"16.18.0","_npmVersion":"9.1.1","dist":{"integrity":"sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==","shasum":"cdd8099f71024e149e4f6fe17a7d46ecd55f1e32","tarball":"http://registry-npm.ywwl.com/css-to-react-native/download/css-to-react-native-3.2.0.tgz","fileCount":44,"unpackedSize":90021,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDXExo786IT8b7xLRd7Vb4u48vFa3L7Xm8UdlhUEFZj5AiArGrKzm1cq+bKeoi4R/AKGrp/gOCMio1SO996N++S61Q=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj7Ak+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqBTg//fuh1iiLgdDMfTWC3Ry6k8RxhAKeK4HdQGp7xacOW7LPLHnCu\r\nZtSbKmB4Q0xx5I8Djcex0iEmEN3E9fozWXJVxO2u5AxBDx43ILTKLpbjTw5l\r\nnn3XnOxZoaW58/7Tc2PIS4B8yHJ/2H0SZBuaRtZb/YOlu+rxLGNnFBQVzwWd\r\nRLOBxrKDoZ+5wzj5DNulvw4YhLrtymLrpzkc175JPor8sBMPOjGqPXmu9eY0\r\ntOE6PaQ22MXsITJKTFTr0O4r48WP2zmEEx8JrmTtrzofJCvR67WBvj9M9UUN\r\npDcwG6YpD6QG8zgCe87iC9o1+2E0UcNB0oKd0krpi/tiGzckpvxHQvpmfvjA\r\npgpZ0NI58oV414Cg5g+nnMjfANRuqh9sqEdGa+lPHPWxofXcXqV4+x2CFaUY\r\nVwHFD9VCzqPV99o6SxBhzfe8O/Rc6ABLHsaC06SRlbDJl+p/N1sJZdz3V+As\r\nglF64P9I4xwuUkFR/Fa6MV2ezSYIqDmL+rOik9UrvmbAXHK9ZDbOMIUmhhA5\r\nVICJDT6x1NnmgTIuLS6jq8Wdkfl+CVe21prpxEzMfjl0yAuqKSLDXO8M3Cko\r\nfbdYWwetF2W0O2W5ii/B8gGNXpFbbSXlX+AyuCltr9mx/QplXRGRoYSErWGW\r\nm0/p+wg9MrGQ/jZ8iVZ3t4HCMCsb8WrlgVc=\r\n=XqsT\r\n-----END PGP SIGNATURE-----\r\n","size":19310,"noattachment":false,"key":"/css-to-react-native/-/css-to-react-native-3.2.0.tgz"},"_npmUser":{"name":"jacobp100","email":"jacobparker1992@gmail.com"},"directories":{},"maintainers":[{"name":"kristerkari","email":"krister@sent.at"},{"name":"jacobp100","email":"jacobparker1992@gmail.com"},{"name":"mxstbr","email":"contact@mxstbr.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/css-to-react-native_3.2.0_1676413246221_0.49635673681904513"},"_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":1676413246436,"_cnpm_publish_time":1676413246436,"dist-tags":{"latest":"3.2.0"}}