{"bugs":{"url":"https://github.com/code-hike/codehike/issues"},"dist":{"shasum":"d112f3c5fb86768a2fe8d3a7e11569a170450874","tarball":"https://registry.npmjs.org/@code-hike/classer/-/classer-0.3.0-next.12.tgz","fileCount":6,"integrity":"sha512-5qQmAbCRhdMs4uRpxtYiHYmX8dFxWo9rrVK5jYCvv50mX/iHQWRkfHKAD7nxMXbA6m96j2hmn9nEZYZdM594hw==","signatures":[{"sig":"MEUCIQC5YKd46B71rKv4OXQPUMXL42YGnFsSO70sRe9kNtA5cwIgW6CF5VktaeaT/Uy8uDamjUdQoxjK2KErDfTlJxTE1As=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":10425,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhqMkCCRA9TVsSAnZWagAAuaAQAIsTOtmmp8tgYQDyF9in\nqAX0yDvZf/TCWrkkfRxMtGX/THMG++YoYe0epbnk8/wYZKov4RhX9Yp1U/Yy\n6sjdsKRBWIr86NdEJVnlcfrZOQenFhik6MbFyI8DTUpOVIhd7k/5iSj/k9yA\nD4x9tS3WbuQCOt2OuYRDLXg/gyq5x5QhkfOBm5Ys8tKKKNsuZLvJh4mtJ7nX\nliZUIBaE1aCGFXYdghec2C4bA5LwDDdqTrWu3xffNheKk39fKnmu52LZhokQ\noFOP6XGInYiBP1KzuSxTstkEAnjnun7jwK+GkLHGLHbXNzWB4DfItPyw6bAH\nfG6i758O5nUcZek33sQ3EV2e8PbPnY1QDjuZ37WzheR2dkZDALRbjOZ5dbgj\n8cZEMI6BSE9WxiCV45UYQZzKkEoRE+jhA3x49qJgCxm1LsPyIG8neG+zFt9V\nPJBCGE+UbNeI9dJtFF3lQxspsxRGNOTA6QOnP/G2mOOp37FdAown/tB/GcLP\njVy4/VZxrmx9uS2kZgnOynp0E1eOVQ/uN4TdV/VrPFN5RKon7GPpYr7xIBTv\nL8cq+h597OHf1z74o+5uF+JBfB1BcagusNdopsd8XI91PzeCHiw4mAT/zTeq\n/X6VGuVoEdix5ssTyUPqmhfTd5fX0teXxY9hYXnlsYHDFSKFJWLAr3VVaarJ\nse1U\r\n=1Hif\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":"2ff863e56c8b735e55517b88528444f709a26a22","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.18.1+x64 (linux)","description":"> Classer is a tool from [Code Hike](https://codehike.org)","directories":{},"maintainers":[{"name":"pomber","email":"pombopombopombo@gmail.com"}],"_nodeVersion":"14.18.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"readme.md","devDependencies":{"react":"^17.0.2","@types/react":"^17.0.2","@code-hike/script":"0.3.0-next.12"},"peerDependencies":{"react":"^16.8.3 || ^17 || ^18"},"_npmOperationalInternal":{"tmp":"tmp/classer_0.3.0-next.12_1638451458554_0.4149700203364981","host":"s3://npm-registry-packages"},"_id":"@code-hike/classer@0.3.0-next.12","version":"0.3.0-next.12"}