{"name":"@emotion/sheet","version":"0.7.2","description":"emotion's stylesheet","main":"dist/sheet.cjs.js","module":"dist/sheet.esm.js","browser":{"./dist/sheet.cjs.js":"./dist/sheet.browser.cjs.js","./dist/sheet.esm.js":"./dist/sheet.browser.esm.js"},"types":"types/index.d.ts","license":"MIT","scripts":{"test:typescript":"dtslint types"},"dependencies":{"@emotion/utils":"^0.8.0"},"repository":{"type":"git","url":"https://github.com/emotion-js/emotion/tree/master/next-packages/sheet"},"publishConfig":{"access":"public"},"files":["src","dist"],"umd:main":"./dist/index.min.js","devDependencies":{"dtslint":"^0.3.0"},"_id":"@emotion/sheet@0.7.2","_npmVersion":"5.6.0","_nodeVersion":"9.6.1","_npmUser":{"name":"mitchellhamilton","email":"mitchell@mitchellhamilton.me"},"dist":{"integrity":"sha512-4ZHI5mHgJjyNiC5ilu8r4pZb9MQ37a3qLP0TnEUBhoS85NozvwKYwcdzYCjcQ3VbCU0ZLjKQLfwCp/cy+l/BLg==","shasum":"ddd627125841b38267eb53956d023f0625824820","tarball":"http://registry-npm.ywwl.com/@emotion/sheet/download/@emotion/sheet-0.7.2.tgz","fileCount":11,"unpackedSize":27292,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbXRkNCRA9TVsSAnZWagAArd0P/RPGhuqN3pgVUkcG3fh5\nRWiXyFRJ4Ei13ploXZS8dCLu2iEIFfJ7GyN4uqiMGmMRjZf97m+ElV0Sger6\nOV28EUr2XtMJeJBGwVwKl8sNqAy9L4xZiXvKy2n5DvoRc68Ar7ufUpVnnstp\nqkZqV0+nGpCi4TSiol8Nifd1PpesYBI/Jr1H1h0Y8lkfjaSDCh5J2QPdRFQO\nx3DaJehw3ny0QZCNz/eR3IQPyjRFdZM4Z71coC6k0ErsLhh8kOjnb4lAwgje\nP8DOr+6ZeZ/4H6HnNCvwn0LZeU64OuMiZ3PqVpk5dhh6GiM2mWum+qvx1p00\nvub2ufV3r1uxdTXgI82DYs6X9oUC9jyBJcYDR1D/rx0ky/S1tLnEz68u8T00\n/8IpNSXY4buQibYwi7fq4zCX4o4COa0f8al3xRzpCNc2+2f6YKc5vocdZt8E\nZ3R+equeLnxqxWn0q70/DlkWXAd3K4Z1ni8yxg4DzENwvt56DCB0DKfNp3xa\nPNduOobwZJ6RIQg0zZxYCMgb22WTy3DQQt/4avS2i1LqgUaFQxfiRPgFOqc5\nUqy4qJWdBGszw40JBkuZUP+DeSIGcr5IPoXpTQz/eN0zhiZbhkPoLOIcakd/\n0o3J1ch4ZH7v6Wfuo3/mu/7JfFuQdsR2nN43juHUTvMoYJtrosBxQPjvOvPd\n8OJV\r\n=Mi3h\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCgv07MbPI73Aa0IswCQgphqcPvDvIYCZDYHdYCrXD5BQIgH5PAvHxKGBnztLK00j8O2Uq6PocypqPCUPurksJnVGs="}],"size":5312,"noattachment":false,"key":"/@emotion/sheet/-/@emotion/sheet-0.7.2.tgz"},"maintainers":[{"name":"mitchellhamilton","email":"mitchell@mitchellhamilton.me"},{"name":"tkh44","email":"kye.hohenberger@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sheet_0.7.2_1532827917273_0.017569176383536833"},"_hasShrinkwrap":false,"readme":"# @emotion/sheet\n\n> A StyleSheet for css-in-js libraries\n\n```bash\nyarn add @emotion/sheet\n```\n\n```jsx\nimport { StyleSheet } from '@emotion/sheet'\n\nconst sheet = new StyleSheet({ key: '', container: document.head })\n\nsheet.insert('html { color: hotpink; }')\n```\n\n> **Note:**\n> This is not useful for server-side rendering, you should implement SSR seperately\n\n## StyleSheet\n\n### Options\n\n```ts\ntype Options = {\n  nonce?: string\n  key: string\n  container: Node\n  speedy?: boolean\n  prepend?: boolean\n}\n```\n\n#### nonce\n\nA nonce that will be set on each style tag that the sheet inserts for [Content Security Policies](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP).\n\n#### container\n\nA DOM Node that the sheet will insert all of it's style tags into, this is useful for inserting styles into iframes.\n\n#### key\n\nThis will be set as the value of the `data-emotion` attribute on the style tags that get inserted. This is useful to identify different sheets.\n\n#### speedy\n\nThis defines how rules are inserted. If it is true, rules will be inserted with [`insertRule`](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet/insertRule) which is very fast but doesn't allow rules to be edited in DevTools. If it is false, rules will be inserted by appending text nodes to style elements which is much slower than insertRule but allows rules to be edited in DevTools. By default, speedy is enabled in production and disabled in development.\n\n#### prepend\n\n**Deprecated:** Please use `insertionPoint` option instead.\n\nThis defines where rules are inserted into the `container`. By default they are appended but this can be changed by using `prepend: true` option.\n\n#### insertionPoint\n\nThis defines specific dom node after which the rules are inserted into the `container`. You can use a `meta` tag to specify the specific location:\n\n```jsx\nconst head = document.querySelector('head')\n\n// <meta name=\"emotion-insertion-point\" content=\"\">\nconst emotionInsertionPoint = document.createElement('meta')\nemotionInsertionPoint.setAttribute('name', 'emotion-insertion-point')\nemotionInsertionPoint.setAttribute('content', '')\n\nhead.appendChild(emotionInsertionPoint)\n\n// the emotion sheets should be inserted right after the meta tag\nconst cache = createCache({\n  key: 'my-app',\n  insertionPoint: emotionInsertionPoint\n})\n\nfunction App() {\n  return (\n    <CacheProvider value={cache}>\n      <Main />\n    </CacheProvider>\n  )\n}\n```\n\n### Methods\n\n#### insert\n\nThis method inserts a single rule into the document. It **must** be a single rule otherwise an error will be thrown in speedy mode which is enabled by default in production.\n\n#### flush\n\nThis method will remove all style tags that were inserted into the document.\n\n#### hydrate\n\nThis method moves given style elements into sheet's container and put them into internal tags collection. It's can be used for SSRed styles.\n\n### Example with all options\n\n```jsx\nimport { StyleSheet } from '@emotion/sheet'\n\nconst container = document.createElement('div')\n\ndocument.head.appendChild(container)\n\nconst sheet = new StyleSheet({\n  nonce: 'some-nonce',\n  key: 'some-key',\n  container\n})\n\nsheet.insert('html { color: hotpink; }')\n\nsheet.flush()\n```\n\n# Thanks\n\nThis StyleSheet is based on [glamor's StyleSheet](https://github.com/threepointone/glamor) written by [Sunil Pai](https://github.com/threepointone). ❤️\n","publish_time":1532827917391,"_cnpm_publish_time":1532827917391,"dist-tags":{"latest":"1.4.0","next":"1.0.0-next.5","rc":"1.0.0-rc.0","really-unsafe-please-do-not-use":"10.0.0-really-unsafe-please-do-not-use.2"}}