{"bugs":{"url":"https://github.com/code-hike/codehike/issues"},"dist":{"shasum":"2e1bf857cc99ae37f00ddd1b2182cea6e965aee3","tarball":"https://registry.npmjs.org/@code-hike/classer/-/classer-0.3.0-next.29.tgz","fileCount":6,"integrity":"sha512-YYhjvK0pv9etSWj48G2+elsCT89l0wX8vUwyAVzPKR+DkN0drDDv5Gq41BEbVA1JGSKfxHN1wj239PYYVJWyJw==","signatures":[{"sig":"MEQCIElvujHw5dz438827QPiwtpu1NsXd820LTHQCt+Pd8B/AiBZh7U7eLIjPz74gGKN81gCFwB9Ef/SxEfvnjyqEIl2+w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":10425,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiIKL4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqbpg//Vkjxct7KYQjYVDGqqKs+dmlo0ke+1lco3sH3ij6z2u3qjMMZ\r\n1VD3RBoRcRWnh6RgDjYnujPL/TPkGW+L9p6Kk087fTAvd9xVnNWbFlfEmD9u\r\n8mN7GO6fpj2fHw7w2HnYuCPc+vsEhJY4rypzBjzITQNVjDLqyfuqv4ITZqIH\r\nTLLGkmPZWQ9OUr9rAvYNEfkW/tPlqd39UVO5HTScnxFOPXOnzslkTXOVBkiP\r\nqvprPg7WoOjy5kvrnlt7YzLE5jrwCwb2pNphkrGK478MLgds5TGoTrTRwr1f\r\nwEN7YzUu2lzdTOYETTOso0Qgtqp+CBHWT1DqAmf664SN+H6P1H5GswYvf/Aj\r\nuPxYylEO+QNIblzhRMsB7L+zmtPINQ9G/psNF7oZNz+fD27ayFIQUbgId0ls\r\nIQBV4gQleuJIaSkwE1XnCTXK/fsUZWM37HPiVUhgy/EjgWSqH3TKzV1B+JXP\r\nn8WFrmBMZN2KjTyYuAb2Tv0K11h109NLkWE9/PCno4FQR/JoudXC1hYCzcDg\r\nqk9+ke67SUtqhS4hFfY60Yqbz5O/XJEM9vLo3oBhwmwr7gkLecJTIQaEqV86\r\nDMlFYA+6m+kQOd1gQ3hNDu0SDj/12FjFJ5OC4fvm33+ESBP6+yGXtoE3LvBO\r\nqoIbVl9u+PPmaVb+AQEuhXZm0mSbmq4oDkA=\r\n=jh3f\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":"4659155fee2ddb781b41ea02cd2dae72d2f78a4f","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.19.0+x64 (linux)","description":"> Classer is a tool from [Code Hike](https://codehike.org)","directories":{},"maintainers":[{"name":"pomber","email":"pombopombopombo@gmail.com"}],"_nodeVersion":"14.19.0","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.29"},"peerDependencies":{"react":"^16.8.3 || ^17 || ^18"},"_npmOperationalInternal":{"tmp":"tmp/classer_0.3.0-next.29_1646306040800_0.9354568726777823","host":"s3://npm-registry-packages"},"_id":"@code-hike/classer@0.3.0-next.29","version":"0.3.0-next.29"}