{"dist":{"shasum":"ea513801c5cb131f6949c42ebf45f7c0f83a2843","tarball":"https://registry.npmjs.org/@code-hike/classer/-/classer-0.0.0-cde697c.tgz","fileCount":8,"integrity":"sha512-gR6iSjaSp7pMKX5Ug2tdnqQtaHLhk7RlU2enB3d/+KxKHYJc6k3+a5QiGLkvdnUD0GIiwLKX/hfKjr3ej4c1IA==","signatures":[{"sig":"MEYCIQC9q+5CCwMivf//Zs24FG2BogHhG0PjIsgh7zH6s+tf1QIhAKgyOX5UtiBo1ESi/fN/QMJbDMf+st/IfyqlcahD5yZc","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13033,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNUa/CRA9TVsSAnZWagAAL+kP/RgXp/60aMucFhXU1FYg\n/gwtGfuD275miH+2LzIprQ421XiNEfLqja8r3v8PLrk+/0N9XSqm0k4gXAGu\nRKf3WXs25onmM5hJGhlH9H6s+p/7O3dn/WsOK6iajHpbUeMm+bQnOrvnDCDc\nQYWtdCG8JVeaC83n2xvB5czTYQ6PMfrSs+Yl63Oitq1gzh1P4tWeBXHEvbo0\nQsC7e+qF6caDRMzSme59eCj7Btod3C6+AhAPTHeb8+dxw6BcaNWHiJH+lKs7\nO8R/lr+Y2SI5JHLcXH/b7vDnVHKtPbmLMLzSccWjH0hNMuHgktu9Ms7Whvee\n/yRxH+cgXQHHi5i7qBNIXuGQaFap0P5L+3Wb7fFO6dtpfVXVNTRgXUY6Erpp\nAsihAnjE3K9tOqCFnludGGj4tQYI0+O5vGF2DWUUq79scJyL+/1EPeVoAK4U\nnHQaZ/SlbhWha+xhRKJXRRmg5m9pc5Yl1K2wzbC76CTzWUZ4WHoSXawJfHW5\nltfksjf2LY7uQWZ7KMoqZHqGbjSSLwVkIWOR8Zd9NnyHxycC1R/n6/txSoiS\nGxsDHW1lgFYsirsyqLfK5BHSquvUGEcguTeEcuCltPx7zaexDIScsnsoq+dZ\n8y3ayu1DZUi/4waUlId5rOudlWs2d7Se2/Fslxj3ht3OdEwNpKIomHWzj9ae\nPuSy\r\n=+1k6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.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"},"license":"MIT","scripts":{"script":"ch-script","publish-canary":"yarn publish --tag canary --access public"},"typings":"dist/index.d.ts","_npmUser":{"name":"pomber","email":"pombopombopombo@gmail.com"},"homepage":"https://codehike.org/","repository":{"url":"https://github.com/code-hike/codehike.git","type":"git"},"description":"You can also do this (to avoid passing `classes` to nested components):","directories":{},"maintainers":[{"name":"pomber","email":"pombopombopombo@gmail.com"}],"_hasShrinkwrap":false,"readmeFilename":"readme.md","devDependencies":{"react":"^16.13.1","@types/react":"^16.9.38","@code-hike/script":"0.0.1"},"peerDependencies":{"react":">=16.8"},"_npmOperationalInternal":{"tmp":"tmp/classer_0.0.0-cde697c_1614104254633_0.45474403403601427","host":"s3://npm-registry-packages"},"_id":"@code-hike/classer@0.0.0-cde697c","version":"0.0.0-cde697c"}