{"_id":"@ads.silva/stylesheet","name":"@ads.silva/stylesheet","dist-tags":{"latest":"3.2.0"},"versions":{"3.2.0":{"name":"@ads.silva/stylesheet","version":"3.2.0","license":"MIT","description":"A styles engine for Node and the browser","author":{"name":"Diego Muracciole","email":"diegomuracciole@gmail.com"},"homepage":"https://github.com/diegomura/react-pdf#readme","main":"lib/index.cjs.js","module":"lib/index.es.js","repository":{"type":"git","url":"git+https://github.com/diegomura/react-pdf.git","directory":"packages/stylesheet"},"scripts":{"test":"jest","build":"rimraf ./lib && rollup -c","watch":"rimraf ./lib && rollup -c -w"},"dependencies":{"@babel/runtime":"^7.16.4","@ads.silva/fns":"1.0.0","@ads.silva/types":"^2.1.0","color-string":"^1.5.3","hsl-to-hex":"^1.0.0","media-engine":"^1.0.3","postcss-value-parser":"^4.1.0"},"gitHead":"f207c177650d9109b80b2983434fa3741ac485f9","bugs":{"url":"https://github.com/diegomura/react-pdf/issues"},"_id":"@ads.silva/stylesheet@3.2.0","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-wdN6VItJJvq3unBak6GTOGFyhajXV+lGQdpnZmXdL/MNbGIeKS6P+OC8wTjwuQOlimBueBBHVKmZpv0fuC5tww==","shasum":"d8df13363d8d9aea194c95096f0563f9b40e103b","tarball":"https://registry.npmjs.org/@ads.silva/stylesheet/-/stylesheet-3.2.0.tgz","fileCount":4,"unpackedSize":41627,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFjc2xRrk3lOxH1UJsezGJ+AfzWausdn2TcOZw2ImiGaAiEAteOA4RODZxs8ahbcNsHfNTRvi3/B6AmRBBLoMNNw2w8="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi9V9SACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqUVA//VT/rgio0CLc7837vV81LONAOD63d/FeN65GhaiWRC4szHaGV\r\nMH7mHoNEr4IflOJSCoEdO11MNJ03kV/2wbbgHpzl3WI9YoWrZ/v5mtOqsK3E\r\nnPceRuU8fKd3rXsTV6nO14YwJpHr8y3xo/sjsd5KKD9kRolzxyt36zZmXUKl\r\nvcSSfsYF2YPcu21hF45s+YGvfMKtBnXb1UesFsIZrxgin8fJMT70wYb+9yzG\r\nBj9Yzvm9gQhe19LCk2NlzHxP6yiWisRRe876kBqcYUnH8oA5nkkd29x4drHD\r\nNQ7/4F33qKyaU5hSixW4oFqFf13LcbS7WwbIL40DFX1bKKwN8YtUCCcXH7dx\r\nmbOhb9LNXUKCfqGngxuzgIzZos1u1lF9yvY6SdAFB0nufUSWA1Usdr3YSv4A\r\n8v17EM8Oh6s6ZK4HU9ya9NAuG5idWpYIyzMeT5qb4w5wPZ4UEeUJNh2Fcho/\r\nlyi58NFZR89J/AULmwkkgwENOqchaopvZuu1KvDzXxh+sACgdmvpiZmyJM47\r\nea9kkUnZWIyLwPxSJPEWOZVJjr0qgVdY3lg91xTCQ6vlTBoOCsWnDGrXgWgp\r\nSZedWiOPR+9cAVJuUJX/g5vppIP7NaEpZ1vc/EwwZ/YWRjlh3pYHib9c+14S\r\nYUCCUhBy2oclCKl/OIXh7+f9jMLftWh6eBQ=\r\n=4Bvo\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ads.silva","email":"dautodroid@gmail.com"},"directories":{},"maintainers":[{"name":"ads.silva","email":"dautodroid@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/stylesheet_3.2.0_1660247890067_0.9116224513332869"},"_hasShrinkwrap":false}},"time":{"created":"2022-08-11T19:58:09.981Z","3.2.0":"2022-08-11T19:58:10.217Z","modified":"2022-08-11T19:58:10.410Z"},"maintainers":[{"name":"ads.silva","email":"dautodroid@gmail.com"}],"description":"A styles engine for Node and the browser","homepage":"https://github.com/diegomura/react-pdf#readme","repository":{"type":"git","url":"git+https://github.com/diegomura/react-pdf.git","directory":"packages/stylesheet"},"author":{"name":"Diego Muracciole","email":"diegomuracciole@gmail.com"},"bugs":{"url":"https://github.com/diegomura/react-pdf/issues"},"license":"MIT","readme":"<p align=\"center\">\n  <img src=\"https://user-images.githubusercontent.com/5600341/27505816-c8bc37aa-587f-11e7-9a86-08a2d081a8b9.png\" height=\"280px\">\n</p>\n\n# @ads.silva/stylesheet\n\n> React-pdf styles engine\n\n## How to install\n\n```sh\nyarn add @ads.silva/stylesheet\n```\n\n## How it works\n\n```js\nconst stylesheet = require('@ads.silva/stylesheet');\n\nconst container = {\n  width: 400,\n  height: 600,\n  orientation: 'portrait',\n};\n\nconst style = {\n  margin: 20,\n  width: '50vw',\n  height: '20vh',\n  borderRadius: 5,\n  fontWeight: 'semibold',\n  borderBottom: '2 solid yellow',\n  '@media max-width: 500': {\n    backgroundColor: 'rgb(255, 0, 0)',\n  },\n};\n\nconst computed = stylesheet(container, style);\n\n// Computed\n// {\n//   width: 200,\n//   height: 120,\n//   marginTop: 20,\n//   marginLeft: 20,\n//   marginRight: 20,\n//   marginBottom: 20,\n//   marginBottom: 20,\n//   borderTopLeftRadius: 5,\n//   borderTopRightRadius: 5,\n//   borderBottomLeftRadius: 5,\n//   borderBottomRightRadius: 5,\n//   fontWeight: 600,\n//   borderBottomWidth: 2,\n//   borderBottomStyle: 'solid',\n//   borderBottomColor: 'yellow',\n//   backgroundColor: '#FF0000'\n// }\n```\n\nThis library exports a `stylesheet` function that takes two arguments:\n\n- _container_: Container where the styles are being computed into. It specifies the `width` and `height` in points (needed for media queries and unit conversions), and optionally the container `orientation` (needed for certain media queries).\n- _style_: Style to be computed. JS object with raw styles that you would like to get in a normalized format.\n\n## License\n\nMIT © [Diego Muracciole](http://github.com/diegomura)\n","readmeFilename":"README.md"}