{"bugs":{"url":"https://github.com/tw-in-js/twind/issues"},"dist":{"shasum":"bf7407d447654a5e21b0e256a05c76e81dbcd9f5","tarball":"https://registry.npmjs.org/@twind/core/-/core-1.0.0-next.14.tgz","fileCount":15,"integrity":"sha512-Nalhg09vA3rzFEd+qEokUbWDKuUWlQ3O+QfSKotIFsJFIuVpRMriOYELe6ZCh7g3P95EL9nIdhYNHbMMS6m3Mg==","signatures":[{"sig":"MEUCIHagVuj8UhzML2bqqQzXCWDTTdbl1Q8/W5R9TINdX/EcAiEAvvFntjRk+KzSGa+veNHjzEebTDyWrNe4iksO4f67/vM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":405965,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6C37CRA9TVsSAnZWagAAy/MP/0NjGxmNM+1zQdvz9cI5\n3myQVMiDFbI4z+1Y/a5OtrZokF0r1bQTaksNdORQ5Lyo+pdlqtOcmWhaV2em\n3acDj/nMTtk6bfLOTbnqWutm6I7jeaRrtMHHwivb4WVcTPD+BItszJZ1Rt15\nN+Tls70arOQPbNh4nCojyil9Yj1IYYTkGRiciS13EysVqikYHgpw6mtQQmdI\nwE3ROKMp2gJyPF90jNpVu7X2mZoQgm7kaB8Ao4J88jurJ0M4zQBokG5JlxjP\n94N7CyIlnj7iEOkiIZuFTBkY3sXVRmKRXHLPkRXurEZMbQ/HScdaKEpV4299\nZBcb/U1S1fcWHkGizwBCORlW8efHSzH1IqfAxkk0F3MI+tqQt3vbysMkNby+\np+CmlE6JYp5I+qYz7egI69wHLZUzIUM83O/xTe3UxIqzFIqu+Gtg/8JDQwkJ\ntXG6hUGe5mJQv0KndNsLOelavObXUbVwzNpNpN3IoN2GR3/JYrJUG2gFYzme\ndD2lNyHXO76O8NRYrHQr1NBYMSZ2pkGMQSGrTekG5KTQt1GGCzNCfu2XuYsI\nstjxvhS5jh1SriQL7lvtlQW6kzca77QAdmmL+OCcaF1RCfu3Wr3muLLsTZBa\niOCHbTjwmNCfM2m1zokjIrLLjYZzTrR/6Evriy9GQXaKc/Ijj4m3Oa4VGNlp\noPjY\r\n=Zc7O\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./core.cjs","name":"@twind/core","type":"module","_from":"file:twind-core-1.0.0-next.14.tgz","types":"./core.d.ts","unpkg":"./core.global.js","author":{"url":"https://github.com/sastan","name":"Sascha Tandel"},"esnext":"./core.esnext.js","module":"./core.js","readme":"# @twind/core\n\nMinimal implementation of a tailwind-compatible CSS-in-JS framework.\n\n**This package does not contain any Tailwindcss rules. These are defined in [@twind/preset-tailwind](../preset-tailwind).**\n\n---\n\n## READ THIS FIRST!\n\n**Twind v1 is still in beta. Expect bugs!**\n\n---\n\n## Installation\n\nInstall from npm:\n\n```sh\n# Using npm\nnpm install @twind/core@next\n\n# Using Yarn\nyarn add @twind/core@next\n```\n\n## Usage\n\n```js\nimport { twind, cssom, observe } from '@twind/core'\n\nconst tw = observe(\n  twind(\n    {\n      theme: {\n        /* .. */\n      },\n      rules: [\n        /* ... */\n      ],\n    },\n    cssom(),\n  ),\n)\n```\n\n## API\n\n### `twind`\n\nTDB\n\n### `cx`\n\n```js\nimport { cx } from '@twind/core'\n\n// Set a className\nelement.className = cx`\n  underline\n  /* multi\n    line\n    comment\n  */\n  hover:focus:!{\n    sm:{italic why}\n    lg:-{px}\n    -mx-1\n  }\n  // Position\n  !top-1 !-bottom-2\n  text-{xl black}\n`\n```\n\n### `shortcut`\n\nTDB\n\n### `style`\n\nTDB\n\n### `extract(html, tw)`\n\nUsed for static HTML processing (usually to provide SSR support for your javascript-powered web apps) — powered by [consume(html, tw)](#consumehtml-tw)\n\n**Note**: This clears the Twind instance before processing the HTML.\n\n```js\nimport { twind, virtual, extract } from '@twind/core'\n\n// can be re-used\nconst tw = twind(\n  {\n    /* config */\n  },\n  virtual(),\n)\n\nfunction render() {\n  const { html, css } = extract(renderApp(), tw)\n\n  // inject as last element into the head\n  return html.replace('</head>', `<style data-twind>${css}</style></head>`)\n}\n```\n\n### `consume(html, tw)`\n\nUsed for static HTML processing (usually to provide SSR support for your javascript-powered web apps)\n\n1. parse the markup and process element classes with the provided Twind instance\n2. update the class attributes _if_ necessary\n3. return the HTML string with the final element classes\n\n```js\nimport { twind, virtual, consume, stringify } from '@twind/core'\n\n// can be re-used\nconst tw = twind(\n  {\n    /* config */\n  },\n  virtual(),\n)\n\nfunction render() {\n  const html = renderApp()\n\n  // clear all styles\n  tw.clear()\n\n  // generated markup\n  const markup = comsume(html, tw)\n\n  // create CSS\n  const css = stringify(tw.target)\n\n  // inject as last element into the head\n  return markup.replace('</head>', `<style data-twind>${css}</style></head>`)\n}\n```\n","engines":{"node":">=12.4"},"exports":{".":{"node":{"import":"./core.mjs","require":"./core.cjs"},"types":"./core.d.ts","esnext":"./core.esnext.js","module":"./core.js","script":"./core.global.js","default":"./core.js"},"./package.json":"./package.json"},"funding":{"url":"https://opencollective.com/twind","type":"opencollective"},"license":"MIT","_npmUser":{"name":"sastan","email":"s.tandel@me.com"},"homepage":"https://twind.dev","jsdelivr":"./core.global.js","keywords":["twind","tw-in-js","tailwind","tailwindcss","tailwind-in-js"],"_resolved":"/home/runner/work/twind/twind/packages/core/dist/twind-core-1.0.0-next.14.tgz","_integrity":"sha512-Nalhg09vA3rzFEd+qEokUbWDKuUWlQ3O+QfSKotIFsJFIuVpRMriOYELe6ZCh7g3P95EL9nIdhYNHbMMS6m3Mg==","repository":{"url":"git+https://github.com/tw-in-js/twind.git","type":"git","directory":"packages/core"},"_npmVersion":"8.1.2","description":"compiles tailwind like shorthand syntax into CSS","directories":{},"maintainers":[{"name":"sastan","email":"s.tandel@me.com"}],"sideEffects":false,"_nodeVersion":"16.13.2","contributors":[{"url":"lukejacksonn.github.io","name":"Luke Jackson"},{"url":"https://github.com/sastan","name":"Sascha Tandel"}],"dependencies":{"csstype":"^3.0.10","@swc/helpers":"^0.3.2"},"publishConfig":{"tag":"next","access":"public","directory":"dist"},"_hasShrinkwrap":false,"peerDependencies":{"typescript":"^4.4.0"},"peerDependenciesMeta":{"typescript":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/core_1.0.0-next.14_1642606075233_0.6402219015615132","host":"s3://npm-registry-packages"},"_id":"@twind/core@1.0.0-next.14","version":"1.0.0-next.14"}