{"bugs":{"url":"https://github.com/code-hike/codehike/issues"},"dist":{"shasum":"b7aca9e47c8edbc61fcd92ddbda0bf333407a3bb","tarball":"https://registry.npmjs.org/@code-hike/classer/-/classer-0.3.0-next.3.tgz","fileCount":6,"integrity":"sha512-UAh1hHiDhvxmV42LcLnWkgpcZqd5L3dHVGXV9l3sMaDTFSBGe3VWsBkpou5myFRNLsDRVw1eKuMuKi/tBpV6Vg==","signatures":[{"sig":"MEQCIGQZH43Bz5q+hWi4af2VUkztNqTkC9gj5FKr2Wlm/mP2AiBRgRpRAya1nR1UzTk13SPnZS+JNYPpUVdZGJjKN3B8uQ==","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\nwsFcBAEBCAAQBQJgWZf5CRA9TVsSAnZWagAAZYYQAJFyqobKA5VQSlmHJQE8\nbwpL6byfZRAbe7tgeD9caT+Qm+kRxUF8CnuSnfVqumxgUC7MIbyXqv7DO+vc\n/Z5wpMDS68OR+DRmlTfvq6L/ojn0T6yUl/16wCe96bWYPuRGS3jj5tdKnxyj\nNop0q0ssX085vhG2gNzoCfTVM5U9RYwhtifJpA84kNeVJ3m9j1Tf3OXUXEUR\nhpL8WLKvAxBLXNxlmuCaasursH/Jewi3NjzxLAQp3pznkxdVq+ZHFXgO1evg\ncm2tAkgG2RYR0l1FUA5pyTHq9Cxr+BjmM7UNmbHmp4126JbvhUJWvLdUXHh1\nBNsuHRA+hrKTTrHKcxM4c2PXLs7/tNMlVKrisQrt6of9zmSfTjVZDxBQ/sh7\nhj9JnsUZQZsaUF8KcyJDEf11uOqU3INmwdgtZEDqgWABeY5RALM4HBHj5Axj\nT/7/IgJM7bpeVemKgCQ9nBjOtOEBlr/pXw8QcnE8/2WlM9PMAjzAvgW3v5d7\nd22FNIhn+7jFDwH5+tcsWBy+JLmydeF7cT+o7J8gYFsL8MwxX63NHzF1stsa\nXsIfrrGruS/PfV5JiBgOr3Ac7pi3vfcdBILtsjl/Vejf0WCE/1/kNdiwVe4T\n/hhWayF7l/9xls6EJvN4a2rwyZYZ1qpzYDXCZSY9BE0EFO/SDxuz9be9EDrr\nXND1\r\n=AbuL\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":"78537ebb04d6370e4b9dd3a8f35a10d6fd2c0250","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.3"},"peerDependencies":{"react":">=16.8"},"_npmOperationalInternal":{"tmp":"tmp/classer_0.3.0-next.3_1616484345184_0.577275393886231","host":"s3://npm-registry-packages"},"_id":"@code-hike/classer@0.3.0-next.3","version":"0.3.0-next.3"}