{"bugs":{"url":"https://github.com/code-hike/codehike/issues"},"dist":{"shasum":"76ea773790e7de0bb838e5cb8c3deee40fce06aa","tarball":"https://registry.npmjs.org/@code-hike/classer/-/classer-0.3.0-next.7.tgz","fileCount":6,"integrity":"sha512-1mdoDsEv50er1NJZJCn6fd3u80WOO/ukuBJiADvtRrA2QlyL64zFPsdzyHaoDCRBqJR4n5cv1XPfKz3U/5FN2w==","signatures":[{"sig":"MEUCIGQDe/Z0a6zsvo1+voW+BE++bGqYjZEUJGu2fd6InLWBAiEA3rtTzXy8jM9DOsJfwCqhiDa1E6FEKnlJcGCLU5IsSsc=","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\nwsFcBAEBCAAQBQJgbHP0CRA9TVsSAnZWagAA1jwP/R7H9trL8ThhmTzcJ0yu\n1sRJF6RPkBCUHcf0/kEcmurF54vjQo/kHZVLVVtR5IREseC9E32p0uqfNt/J\nWzUVej9viHp5ZJTn699km91YUcSG7OaxtWFvvCNhM9yZfqVqx2NRAb4Q6ndR\n1gZn3zuzRHnXztBI6Bq/st2SCShf1IuBw6788P+2fU6M7B5tS5kxm/ybdJI8\nWCCBwfFcCFgc/B/nmTF0BUFwOCq6GDJa066Rv/efoF4g9yoA2/Cyqi8Cq2Xn\nxSOUSxsNdtWNODOAUh4M/Du8gxP/IpJwzxFOPrXV1Fnvy+8M+8WadSiEiWU8\ngkboH0NTLkx0Q6EsNtC0FgxF5fdxIZiZmL/ZE+HoO7ulN86ihuPMZyYjMwLx\nnLl5QzjNXOI2i4H3Ug/NRAS3EyW8WuSI/vZh/Y1/endxTFQjTJNrOyrbS070\nqN0d2kfmsmoQk8lroTU1iwJpFA0IrFpwcSg8SwCvOaJzM+GGuvZGQzqw1Ucr\nNxnVuxwTzQHaACJqhJUjuhnHjlBGwUBmEI1yngB3MFZddCeBw7wCHuzSL0yn\nCtyBkQMe5jy1Z4kLz5KYGwxS7/zi1OB2U9LkazEQLDj1Pjzk+tO2fjtpB2Fn\n4oLh9xug6+bKjLVn4CbaruPI5jD+PW1N92sM2rk+Ax+ZdxAyHHrfrLf+yMsI\nW7rc\r\n=+gx7\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":"2f24d0d910de92f30ffec96a9f768f197f81f1c9","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.7"},"peerDependencies":{"react":">=16.8"},"_npmOperationalInternal":{"tmp":"tmp/classer_0.3.0-next.7_1617720308181_0.6385402489468299","host":"s3://npm-registry-packages"},"_id":"@code-hike/classer@0.3.0-next.7","version":"0.3.0-next.7"}