{"bugs":{"url":"https://github.com/code-hike/codehike/issues"},"dist":{"shasum":"bafa090fe18514f62228d51216f8119606a094a3","tarball":"https://registry.npmjs.org/@code-hike/classer/-/classer-0.3.0-next.4.tgz","fileCount":6,"integrity":"sha512-1lG0c1iFMHRuBcU1vf3Zd7hpzl5+X/XXVyEhQ2mRtZZtpBiTslYvodM7rHjbTugugGNR8m07HSnOEdKIrdrlug==","signatures":[{"sig":"MEQCICGWgI0SvVje6i30quHThyPPAG+pzGO1WPbdxBRFw1KDAiA3n60Tkdg/+nee6GzsIbt2CRHyx0Dp/OsJydhmnvx5Ew==","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\nwsFcBAEBCAAQBQJgWiwhCRA9TVsSAnZWagAApl8QAIEYZ4k970AwBZUa2yas\nXiivxTGW39yjgAgqME8noDMHR6fcmttoHdQXmoQByzQm6AkEyWwZZV5RuAfY\nluvw+/o2PX3SoRWOI2JC4nuiTIdTHUMPBKfPVwDNDSJdSCFGXJbjc41/PSQm\n07JLDiSj7saapMpp1Xnfb2eN2715Ev4/8PpF2KV3ZO+SS0WNzcXa7o0U6rCR\nw7IwdZv2FZqKN/n74ALULIkd1z3nA+s4QGOEDJ/eb/hl2KWFrQchw5xiSRdV\nTNkBSj+qlDVnO6Kt8rK8G21vuvT/MU7HCvua57xVtvkn/3NsIw0H9aoIOsJw\nwPqLgf7Cd9h/2Etp1kIHD1MM4CLzKhDund03/FwhkGu+Tfo8QVCTz3dPSVBP\nYxfeFeoOhLRSElo9moVpGOTzbAH1jmqHYK0T49zxgUtTZATLB1uTNaA35pNz\nwKaZBYGMs+HSmeaAjfRGA97Gh29pXMp888X1lcVE/inxuaiRKqMToFLI/sYA\nZ+MokGUgALNvzh6D0HAtMGuKr8lmOyYQMjKmu2sLn29C8tbuqlAsEE/0iNjF\nRwn5GfIAbfyW1qTBQxGuuNOuAk08Y1qIgjnJD+PQq9SxTOsxIGDHYfwI5rar\npJw69xE3d3FpIKh4C8Th3VbTqjEMhJk00bMkeqWMx7Yf1gfEGU88B4UsABBx\nQIvq\r\n=M9iw\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":"44ce0c148203f8222579db3c376d36a5ed414a66","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.4"},"peerDependencies":{"react":">=16.8"},"_npmOperationalInternal":{"tmp":"tmp/classer_0.3.0-next.4_1616522272948_0.005602142761549578","host":"s3://npm-registry-packages"},"_id":"@code-hike/classer@0.3.0-next.4","version":"0.3.0-next.4"}