{"dist":{"shasum":"2b9b9dc4cfcf872e03aa59f233a2c3f4dee5c62e","tarball":"https://registry.npmjs.org/@code-hike/classer/-/classer-0.0.0-2c9642f.tgz","fileCount":8,"integrity":"sha512-zTMUpQDrUQTVgAVOQl55NbQtBWslUUVuvd9BzolRqb+moRqF9zNDwjF9KWS4wxPKbjOBs2V5e4R4L9DjT3+Cnw==","signatures":[{"sig":"MEYCIQCcHtxExjJ1TwVR32iGgp8ZM8CWisE/jKJ7KF+bwcTjDgIhANmVERJrECFd/I3JiNtvFn0YG9f1BTpVlruvILDzL/YZ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13033,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPFzQCRA9TVsSAnZWagAAVKcP/AlxCbXwe8qmat6PrXlw\nWvM3T/LqVsUYfp1uR6/rQ3KrDupI2Q3hzKR+E6s9H/ppzdU8EMYLETy0ODSm\nGSCJMy+zE2X2slpxIifgjquc0KddwJkFuyj1JHJPaki9XJCyf8UK8H2JLA0u\n861PvUsocvTgieYmIZ23Nz9JMSy1n5wtXXp6SdCT//a6wO10zBgjuyBYETqq\nxOeEL2oJ69qMmUL4BnamP0D+W8Q2x2m2BIIcIbsujku3DMe3cOAb0Pp/EEhW\ndHQ2wBFYdoHLQeaPvt8aeYJ+r9yWV0RqnalpSdjR5OeVIXXf7X93JTAHViM+\nNjtIW8j+Cfk3v6rF5t9Y6MdfUIX6j5v29Oty622/kx+4+gMd2Nt8xpz4Gdy8\ni7l1vGChE7wwI3aBM8cgGqBP+R5RcMqGaYYIFUGvpOUF7BFMnVCRGcUPqrNJ\nua948HUnxf0aspB1h0ztXyifp1pGE0Kacf6U5H1RGOHEEC5Uizpzxgj4KAwE\npkIdI2Zqd6odmExuAmpKo1pSUO5xL4N408zgIzT6qSR0jM4ixqPuTKdlnxQq\naAj3CTmQD0QPe1EM+uaEQW4c7PunoVU/JI8XbXbgc1XUfHYvM6Cm4G/p34PT\nxsoJVc0Qm9gUaGm+mBs5KD7jME9ALaivy8kPp45rRGk3hwtdMiWGvf8eqhZR\nworq\r\n=cAJY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.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"},"license":"MIT","scripts":{"script":"ch-script","publish-canary":"yarn publish --tag canary --access public"},"typings":"dist/index.d.ts","_npmUser":{"name":"pomber","email":"pombopombopombo@gmail.com"},"homepage":"https://codehike.org/","repository":{"url":"https://github.com/code-hike/codehike.git","type":"git"},"description":"You can also do this (to avoid passing `classes` to nested components):","directories":{},"maintainers":[{"name":"pomber","email":"pombopombopombo@gmail.com"}],"_hasShrinkwrap":false,"readmeFilename":"readme.md","devDependencies":{"react":"^16.13.1","@types/react":"^16.9.38","@code-hike/script":"0.0.1"},"peerDependencies":{"react":">=16.8"},"_npmOperationalInternal":{"tmp":"tmp/classer_0.0.0-2c9642f_1614568656421_0.17181396242472902","host":"s3://npm-registry-packages"},"_id":"@code-hike/classer@0.0.0-2c9642f","version":"0.0.0-2c9642f"}