{"bugs":{"url":"https://github.com/code-hike/codehike/issues"},"dist":{"shasum":"4addde1418131a389d6e07ebbd0d7016504b5a77","tarball":"https://registry.npmjs.org/@code-hike/classer/-/classer-0.3.0-next.11.tgz","fileCount":6,"integrity":"sha512-Jx+R2ddWE8GKfSry+HbJ4Ti/yVw5ef01VvwCOBC8JGGn5ZKvL7IQffj9u0uy151COZ3+omMWZp+/wm4ThUXhsQ==","signatures":[{"sig":"MEYCIQDmIf6cp7tDgrK4838UzLYplkC3YxVGzIlMYSAAsxrVcQIhAKgdtW9hmyw35FhVx/B57K8g88eGnpIYx7Ku5Zdo38fp","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":10412,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg8XCyCRA9TVsSAnZWagAA3IIP/1i/brmJt/20OUtsiYFW\nbl7N1ODrPn2vY7x9MCfeMtMF3uk20zvcfxtvAqW2GTRTaIW6HOaOw7XSE0oI\nl8tBc0NGvT1tVXNv1iMZmW1FiE+iVBfRCPBBPe3sS5Z+5q3z0gS8Ow0/8dei\nIGK6RUg33vxnT6DOCi3V3jctp8qXI9GyXf8iXvwczebgZZD/0SpuZwKYNr8n\nsJuYJHt6Ywvx7pAP4Q55JVYGCTaYLAMC8hhmlWkYBg3qqYdvhkXu/fGt5XS1\nDtPgkGK9fbvleOefzyw6WR6WCNDW19odKob8klh5MNKWW6qouFT21omISWHx\nKt7KskW05mhtauZcPiBOudcRVLBGm+9bvOSWd7bAh7OtkhieUrwvtUPkKd4A\nu6qXPD4GKTzaTttC+CTrI2JqAM8GyA2JzHRJ2k2vQEyRxdBHEX1KltRpYqG2\nJh3ULJC21ITP4gftmrEBSnVfTkGKauho+PxJ4uHsB0kzKPMLO6Ucq3OWJd+z\nysWta9z2/s7VjSXlG2/k+VvdiA+0f5C391me0wBloKIZhGwvgkrVoO/uTOlu\nEJbOBRY975PMq31aUM0HxQ4MnMl8IvgFx2TkT3keunFx89JJNYml+np4kzig\nMCJUa2uBC+xxsNHLiOcN48SdM9QPare/A4/vlJeexvqwnlO5zqzXy1A7OVjb\nbhVa\r\n=rvjN\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":"0af981663c74dd5d89f486839bddf1740bafe4c2","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.17.3+x64 (linux)","description":"> Classer is a tool from [Code Hike](https://codehike.org)","directories":{},"maintainers":[{"name":"pomber","email":"pombopombopombo@gmail.com"}],"_nodeVersion":"14.17.3","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"readme.md","devDependencies":{"react":"^16.13.1","@types/react":"^16.9.38","@code-hike/script":"0.3.0-next.11"},"peerDependencies":{"react":">=16.8"},"_npmOperationalInternal":{"tmp":"tmp/classer_0.3.0-next.11_1626435762135_0.2356663592804371","host":"s3://npm-registry-packages"},"_id":"@code-hike/classer@0.3.0-next.11","version":"0.3.0-next.11"}