{"bugs":{"url":"https://github.com/code-hike/codehike/issues"},"dist":{"shasum":"240ef681be0d8dbad87871a5f303d9b65ba55d69","tarball":"https://registry.npmjs.org/@code-hike/classer/-/classer-0.3.0--canary.116.0186a87.0.tgz","fileCount":6,"integrity":"sha512-Kl8ivqEzgh1K/DySxCcEjCc2M6ccKL1CXqiswHFyHjyUYaPeoKsolVYy+OXkpibIP2DiTAIAt4REQmyqs3ummQ==","signatures":[{"sig":"MEUCIQCa1OamSjozRA9NHIZrkwmi8GMA+EoY4Lm9sCv4Ibwj5wIgeLOd9UqrlBAHBhAGZtcKAa8Hrhi4pbXlwjffX/Oc2CM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":10453,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh8WPuCRA9TVsSAnZWagAAz9kP/RrcaT8cyqA8KuSX8ED6\nU+5tdzPm9KH59a0LcScXCGaTr4JUfqgkU5WHVwvvKH75CFN9cZGUyqW8oF+p\nkNMRT1/VxIuHkEUtKFWDiHwWoGuStQySD/LDZu+fFtG8Oo49Efu7tXdWmFUv\nxGA+X8Hn+7ykdKFFSjYxQ0GO/BMD7LTrOpCN48lfGA5LznKDZ9UbPke2KQHo\nW9Pyf+voGlzCgTqpbCKiDqcNyf58o75CKUtKDokBTL4+rrlB6CSl7l5oZAo/\nh4FX/e/1BRpKuzp21M5xM2GMg0wq9Qth7COdZMinVNkTOLiqzBRAjdi0OYFv\nlXUHxxw+b/PQekLEqcXvHFp2htHmddmZwlV+puWLN8QTdLdUoNllvPuc9agn\nFSUJNbuhY0Ob+pbHLMUdVtH+Ekwhoq4t7cnLgQJGYp4SlmQ6SqYDIznNp5Z6\ndsT3qKTMXsDxWI2DH354IAFCinl0h11XQh5g370igNL/wrTovepQ8RxE+L4I\nLnXcLPYJa2GYB6BGPWOniobVJ3r12SwQMW5ytHp2cAClycitAsW88lzoYT0T\n+ozaevIcdU2eu0myplXkLY1Cnr/GadZsWbSt/tMvq0afmdMDF/DbIF4kHEDR\nU/lGKpflGtv4bymSEgAhqum/j4VVlbvTEyVywHZajy1DB2j2pxoKp8xzL5av\noH5H\r\n=w+dO\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":"0186a8722f3e14c54e147a04d3911ba83ba817e6","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.3+x64 (linux)","description":"> Classer is a tool from [Code Hike](https://codehike.org)","directories":{},"maintainers":[{"name":"pomber","email":"pombopombopombo@gmail.com"}],"_nodeVersion":"14.18.3","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"readme.md","devDependencies":{"react":"^17.0.2","@types/react":"^17.0.2","@code-hike/script":"0.3.0--canary.116.0186a87.0"},"peerDependencies":{"react":"^16.8.3 || ^17 || ^18"},"_npmOperationalInternal":{"tmp":"tmp/classer_0.3.0--canary.116.0186a87.0_1643209710839_0.8548961638922761","host":"s3://npm-registry-packages"},"_id":"@code-hike/classer@0.3.0--canary.116.0186a87.0","version":"0.3.0--canary.116.0186a87.0"}