{"dist":{"shasum":"b41d94d1b8caf977eb11faf54b9716dfeb228cff","tarball":"https://registry.npmjs.org/@code-hike/classer/-/classer-0.0.0-1f0ad83.tgz","fileCount":8,"integrity":"sha512-LkHr8aacu/5kF80Sm1zNMcFI7zg6DHjKeaOb8AEg0Hy9A/eVCpd2N3vYLwFKPCQ9MY9cThzc6Dz/VKcXqne6iQ==","signatures":[{"sig":"MEQCIBAVDG79dZhjmSibhDe/sh4sLzW5LSyd/0NfESnXOKxfAiBSIpaOPMJVk9CB5NxQNGUOcUiL8CCHFlSRR1fOyDT9pQ==","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\nwsFcBAEBCAAQBQJgNpq6CRA9TVsSAnZWagAATR4QAJDX+NAEC1Qp18s0Okvf\nMZxcPWk/hMqPu+78Wdtun98ze65Jdb3ZsGp0uvgf/OtTDioffbUHefkcjrDh\nFlw/qT1e7R3DSj6LFCZq4BhZPkoLyIiCxAPPNZlKiFcKYmhIgvko5bOFJ50P\nOjujLINqD2VwNHRP5+iGREurHjzrUFU23eHfMaFgptpUhLf8Y9baRe1jhBHJ\nBm9mT2BKVcQ/kDFfAQrF9uExKTYjnqGSi7krkF8h3Nh3ZG488jJ/WDIlSr3L\nFRFO2vMu0MMmXu5kbByoFhfbLkROCHkVZV/0WfZTx6yKa2G9HMgnxRNyEgVJ\nKSvgXg44cxGjagTXSLNN2VC1VK6uNYZ8/Km4/T+YZl+iRxprZ1PP/3npjUOW\nYXeXGAxx+JEmfUaSvzmIDwaWOu591RqGN2nu4WM64fVPMvNzLzLgie6Dy9QZ\n/4/zJmk2wqGdoURHANYsztV1WQ/a5N7z+w8S13NcpSYMnbaVyqB/aOiEWiW/\nlwIpQ5Ckcj/Hv5E/ppuS/cmoEO1c+VjwG6uupBYnwkLmNVMD0p2jNt3rA8tV\n+dcp/StgkQJVqqHrkE3bIn+h1zWbmPWNaMpULxibpgmpnxwBE++6BcMIwWDN\nJNRpwEk+hW/vqIbNm0fn/o79VbNhh/Ykot4zbTfYfg92JLVWYlgOZZlMz5bU\npxO9\r\n=PbQ9\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-1f0ad83_1614191289700_0.9225209079757029","host":"s3://npm-registry-packages"},"_id":"@code-hike/classer@0.0.0-1f0ad83","version":"0.0.0-1f0ad83"}