{"bugs":{"url":"https://github.com/code-hike/codehike/issues"},"dist":{"shasum":"b9df30618c604379426ffeb68cb8afb54ed607c5","tarball":"https://registry.npmjs.org/@code-hike/classer/-/classer-0.3.0-next.5.tgz","fileCount":6,"integrity":"sha512-hUARQe6DqBf/51/SCJzfxE9DXTSarpRumMJ5b3FYfEUYY9RM1ov9vbQvdvfi/wHetw/vHzpKh5t0WTUpiVhCcg==","signatures":[{"sig":"MEYCIQCCRV/L0YpT1uBJgisDMSsymqpEpV2g2OeoT7UbDby+NgIhALEBQgZ8ItJjcyxWRS+6hy+aRH74bObH+UInd7i8wDfG","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":10361,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXAgxCRA9TVsSAnZWagAAlD8P/RIGmmLe3sn5sFWiJBcq\nCIkYSh5oxQnvW/6Klq1enl8S7O1TQctEp1ToKn7XXtkjAPfG7mP9gYlAX/Mb\nhCBknLqNaUstPaTKWuLnbDvbKjyh8zFP1Y3wrn28bk/mqhb7bcs7QveLXGui\n0HxPbP3PDhr1JxKiUuiZdFvHZLDhxfH/YZ6BT1eoQoi+5Mgoycz69x9svFuQ\nffhPUhn9dXoSYB937HM3wyiU1aSpmMJ7gKRUCSEI/z2vUNOmJPLwPtu5qJuA\nVuxDteAId041IS3wvQof19K8XwHKO95MdBZCA3uFxRT2xjZ/x5P/G+R8hVtH\n2/6N6BLztO37hjXU6S6FRwUjo0jem0Mvw+/eymWGuHgjEccMt5p7AzqLtLEu\nHS9AN8UrQXQBFUgrkXU2zd4cWpT/LGiaj4BQO8bFfaosZ2crUMp00pP346Ik\nsOk9+XZebhvSViE8QOUGhIXbngU/ovc9rUSM0S70erPuvFp5MYXXKE6MdhMC\naXlIbhSpp0nWN61SfQd2XjqffvT1rjp4e9JX9gi1BrXXPgWa+/hWJKcvGgkC\nOfGiZSd6G14gThrWaf8UEzooklQz0X477jYR5JC5VA69UIuKoWVdBY37Dqjj\nCpGNDXkbtlDGyJFcLPWb1UfvMFzNRWTtypxRAgpxou+L5U11ThOFKNrPDNCJ\nUxwH\r\n=jPon\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.cjs.js","name":"@code-hike/classer","author":{"name":"Rodrigo Pombo"},"module":"dist/index.esm.js","readme":"> Classer is a tool from [Code Hike](https://codehike.org)\n\nA little package to make React component libraries interoperable with most styling solutions. ([See this twitter thread explaining why this is useful](https://twitter.com/pomber/status/1362125599607820290))\n\nYou write your library code like this:\n\n```jsx\n// foo-library code\nimport { useClasser } from \"@code-hike/classer\"\n\nexport function Foo({ classes }) {\n  const c = useClasser(\"foo\", classes)\n  return (\n    <div className={c(\"container\")}>\n      <h1 className={c(\"title\")}>Hello</h1>\n      <p className={c(\"description\")}>World</p>\n      <img\n        className={c(\"img\")}\n        src=\"https://placekitten.com/200/200\"\n      />\n    </div>\n  )\n}\n```\n\nAnd the library consumers use it like this in their apps:\n\n```jsx\nimport { Foo } from \"foo-library\"\n\nconst classes = {\n  \"foo-title\": \"my-app-blue\",\n  \"foo-img\": \"rounded-corners some-border\",\n}\n\nfunction MyApp() {\n  return <Foo classes={classes} />\n}\n```\n\n`MyApp` renders this HTML:\n\n```html\n<div class=\"foo-container\">\n  <h1 class=\"foo-title my-app-blue\">Hello</h1>\n  <p class=\"foo-description\">World</p>\n  <img\n    class=\"foo-img rounded-corners some-border\"\n    src=\"https://placekitten.com/200/200\"\n  />\n</div>\n```\n\nExamples:\n\n- [With Emotion](https://codesandbox.io/s/classer-emotion-b7go0)\n- [With Tailwind](https://codesandbox.io/s/classer-tailwind-wfs1d)\n\n## Context\n\nYou can also do this (to avoid passing `classes` to nested components):\n\n```jsx\n// foo-library code\nimport {\n  useClasser,\n  ClasserProvider,\n} from \"@code-hike/classer\"\n\nexport function Foo({ classes }) {\n  return (\n    <ClasserProvider classes={classes}>\n      <FirstChild />\n      <SecondChild />\n    </ClasserProvider>\n  )\n}\n\nfunction FirstChild() {\n  const c = useClasser(\"foo-first\")\n  return <h1 className={c(\"title\")}>Hi</h1>\n}\n\nfunction SecondChild() {\n  const c = useClasser(\"foo-second\")\n  return <h1 className={c(\"title\")}>Ho</h1>\n}\n```\n\n```jsx\nimport { Foo } from \"./foo-library\"\nimport styles from \"./app.module.css\"\n\nconst classes = {\n  \"foo-title\": styles.myTitle,\n  \"foo-img\": styles.myImage,\n}\n\nfunction MyApp() {\n  return <Foo classes={classes} />\n}\n```\n\n## License\n\nMIT\n","funding":{"url":"https://opencollective.com/codehike","type":"opencollective"},"gitHead":"e6c5886085211baa544c3cd0dede0ca07804a5fa","license":"MIT","scripts":{"x":"x"},"typings":"dist/index.d.ts","_npmUser":{"name":"pomber","email":"pombopombopombo@gmail.com"},"homepage":"https://codehike.org","repository":{"url":"git+https://github.com/code-hike/codehike.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.16.0+x64 (linux)","description":"> Classer is a tool from [Code Hike](https://codehike.org)","directories":{},"maintainers":[{"name":"pomber","email":"pombopombopombo@gmail.com"}],"_nodeVersion":"14.16.0","_hasShrinkwrap":false,"readmeFilename":"readme.md","devDependencies":{"react":"^16.13.1","@types/react":"^16.9.38","@code-hike/script":"0.3.0-next.5"},"peerDependencies":{"react":">=16.8"},"_npmOperationalInternal":{"tmp":"tmp/classer_0.3.0-next.5_1616644145115_0.5791155943252966","host":"s3://npm-registry-packages"},"_id":"@code-hike/classer@0.3.0-next.5","version":"0.3.0-next.5"}