{"dist":{"shasum":"4e2bb3a304453b5ebcc8fdfaa976f4f2467016a6","tarball":"https://registry.npmjs.org/@code-hike/classer/-/classer-0.0.0-4333a8b.tgz","fileCount":8,"integrity":"sha512-mMrpIUZuI9X2kwpA9iGvO8zobC5ygYMCpieqvGKLAhZ8Tk+SZJW/i8AMPAqMPt0nGeG4TiEa9spKSVsnID+iTw==","signatures":[{"sig":"MEUCIQC3eOYByxvTxFJ0onZOKAkOrnCMU/kSMHtnSdR6tHDS+wIgIUExE0opLZ/W/atw2RPFqnZkHhrgxTjm8S/vZSWYHak=","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\nwsFcBAEBCAAQBQJgRYeECRA9TVsSAnZWagAAPjEQAJ/LIVoXN1QTr8R9isW4\nct25NkemubPAuoVou4s39OLiNyH2yHI4BMCHIsQzKdzvUkEOWususUflE23Q\nJj25noLeyjN6sdZoYkv9ZjG+rFhUxXIJVAMoY5fIDuH2dGvbZXmBdqmhNVG/\np9K8mabaGxrg1Z9Pu0ypuI83gu4y+KvCES9FtKQBKqU70tDV7BtUo0io93qM\nPTZna91qYKzDuSddUO1V6XasKELg51OeuJme9OAkFQwRf0QqTWhdBjdFgqBr\nkmq9meo5FRRi5A2jDHGQ9I5maHv84p7/ZeQQVbsMiJw+uVBIgP524uB7Tzql\ncDTogWzHqkNgqBkAwcbhTZTxbVU9wq3soMxYXOIVkWRCBOInNYjlzxnxZlIH\nvKxFvmO1rUJDcS7HCEN5CONGFIorcrGPD1tenOXxUUwNEVnXZ7HLd3aAJbDt\nyLH1frtSH2zRDuNbbqEzWsqjremr/ACjJSswFGQAoeTU/wJSruP2eS+YQyJu\nkqoupuL4ZvmIhU564CQO7Wgmr5UmvRWRAbLsE0/lQqq9+5EP4BW+O6rZA2PP\nun6kU09flo2PVjCLmQhhjps1l9YrmrGa2u9g96QBSeyPa8Q+e3RLoneK0seD\nE+mJ+hVsVw8bkBEDhPnFo+anmHx035hU5PEbYs5qcETjiuVlHX50jI/66jBA\nG+ZD\r\n=xGR0\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-4333a8b_1615169411709_0.9715878041536825","host":"s3://npm-registry-packages"},"_id":"@code-hike/classer@0.0.0-4333a8b","version":"0.0.0-4333a8b"}