{"bugs":{"url":"https://github.com/code-hike/codehike/issues"},"dist":{"shasum":"7b700a6092e505b0df86d903c0f894275232cb9a","tarball":"https://registry.npmjs.org/@code-hike/classer/-/classer-0.3.0-next.17.tgz","fileCount":6,"integrity":"sha512-PsUJJ7ymvwDiXPaVZujHA8oNm8pW71GgY0mqCt2/ZFFlpj8RCyk2KFEpYOa+LtX5eaLj2mxLDGNe/PnS6vEdew==","signatures":[{"sig":"MEUCIQC1KiV4ooGCmnSudrsSbmO4lkpC/v2J6R3tnFm7Wkp/2gIgbum7mDx5biCv29vlxEasVayz43+99ZpAIXU+GTYoUlw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":10425,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhyjRaCRA9TVsSAnZWagAAtI0P/2b4OVBODPYouRjU+/OB\n2OUY4NfBIttUwOwbm/6OOXS//GI6K6VHa6L30my78qVxB44PtWmxwCSOZfsS\nFhLvvlrPXyKI9KZZJKyA1tFrq0xYgEjFcpKST2el0pZh4EjmOH3WP7IHgHH7\nZuwEMVKZl4Lik2GNFNazBd4NnW0RO16INZP9CXye5+Fb06yDFogs3LwWlwXx\nVu/6D8erH+KF/vvNp9CNGdvFIees9Qk9zh8yesTpSR5Q4sLUUljSRMum5gfv\nsQ8Du8XI5O+suWBFanIx9lwQPols7KmUhK00VxZxgDD2zzB6DHJDFk/7s1es\ndFRg7alLsEMC1f1QUK+x+Nfdd3O28R9g8+4vaaMv2XlzRf0dzNNTSxhm17ZA\nvRBm/mKqSLvDs/bBbqffDNFJyPI6HHymkDDHizDHuK90D8Z2Bdi9DDITDjvw\n3pzP6Ph1XBfUqVlXZrLUB/weoestPdJaq+c8pR+ZrmdouP4Onv1Gv9TIxcLN\no3Gd+fWi96lCQrVdPalf/EspuHsKbDHtJKpBBgXAzGekWXQo+3ULKFsRNK39\nQQqRP8c4YD0QP3me3mtCVeGvbm4xGHBYjRur/2dLvTK/dVWu3p4tx3yYjIPx\n20XSQaVOkXwPY33yQUdQaBjFLyi17ZRFmI3abJ7l0lmkV2zRGHxzqRVVJbIa\nDCT3\r\n=BRQO\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":"8e7fdaab18a8dd309ae2336c60ec89d5d5d92733","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.2+x64 (linux)","description":"> Classer is a tool from [Code Hike](https://codehike.org)","directories":{},"maintainers":[{"name":"pomber","email":"pombopombopombo@gmail.com"}],"_nodeVersion":"14.18.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"readme.md","devDependencies":{"react":"^17.0.2","@types/react":"^17.0.2","@code-hike/script":"0.3.0-next.17"},"peerDependencies":{"react":"^16.8.3 || ^17 || ^18"},"_npmOperationalInternal":{"tmp":"tmp/classer_0.3.0-next.17_1640641626131_0.7702395849934089","host":"s3://npm-registry-packages"},"_id":"@code-hike/classer@0.3.0-next.17","version":"0.3.0-next.17"}