{"name":"facepaint","version":"1.2.0","description":"Responsive style values for css-in-js.","main":"dist/index.cjs.js","module":"dist/index.es.js","files":["src","dist"],"scripts":{"build":"npm-run-all clean rollup rollup:umd","clean":"rimraf dist","test":"jest --coverage --no-cache --ci --runInBand","rollup":"rollup -c rollup.config.js","watch":"rollup -c rollup.config.js --watch","rollup:umd":"cross-env UMD=true rollup -c rollup.config.js"},"devDependencies":{"babel-cli":"^6.24.1","babel-eslint":"^7.2.3","babel-jest":"^20.0.3","babel-plugin-emotion":"^8.0.6","babel-plugin-transform-define":"^1.3.0","babel-preset-env":"^1.5.1","babel-preset-react":"^6.24.1","codecov":"^2.3.1","cross-env":"^5.0.5","css":"^2.2.1","emotion":"^8.0.8","eslint":"^4.5.0","eslint-config-prettier":"^2.3.0","eslint-config-react":"^1.1.7","eslint-config-standard":"^10.2.1","eslint-config-standard-react":"^5.0.0","eslint-plugin-import":"^2.7.0","eslint-plugin-node":"^5.1.1","eslint-plugin-prettier":"^2.2.0","eslint-plugin-promise":"^3.5.0","eslint-plugin-react":"^7.3.0","eslint-plugin-standard":"^3.0.1","jest":"^20.0.4","jest-cli":"^20.0.4","jest-glamor-react":"^3.1.0","jest-styled-components":"^4.9.0","npm-run-all":"^4.0.2","prettier":"^1.7.4","prettier-eslint-cli":"^4.0.3","react":"^16.0.0","react-dom":"^16.0.0","react-test-renderer":"^16.0.0","rimraf":"^2.6.1","rollup":"^0.43.0","rollup-plugin-babel":"^2.7.1","rollup-plugin-uglify":"^2.0.1","rollup-watch":"^4.3.1","styled-components":"^2.2.1"},"author":{"name":"Kye Hohenberger"},"homepage":"https://github.com/emotion-js/facepaint","license":"MIT","repository":{"type":"git","url":"git+https://github.com/emotion-js/facepaint.git"},"keywords":["styles","emotion","react","css","css-in-js"],"bugs":{"url":"https://github.com/emotion-js/facepaint/issues"},"eslintConfig":{"extends":["standard","standard-react","prettier","prettier/react"],"plugins":["prettier"],"parser":"babel-eslint","rules":{"prettier/prettier":["error",{"singleQuote":true,"semi":false}],"react/prop-types":0,"react/no-unused-prop-types":0,"standard/computed-property-even-spacing":0,"no-template-curly-in-string":0},"overrides":[{"files":["*.test.js"],"env":{"jest":true}}]},"jest":{"transform":{"^.+\\.js?$":"babel-jest"},"moduleNameMapper":{"^emotion-theming$":"<rootDir>/packages/facepaint/src"},"setupTestFrameworkScriptFile":"<rootDir>/test/setup.js"},"gitHead":"5d6234029b479d41622010a8d1c378d0ac811beb","_id":"facepaint@1.2.0","_npmVersion":"5.5.0","_nodeVersion":"8.4.0","_npmUser":{"name":"tkh44","email":"kye.hohenberger@gmail.com"},"dist":{"integrity":"sha512-yEg1ysS8rb0etDkwJRJwkDC018tznvgjnP6F/DiPVy+fUnlOsDIHjV53iFIOUflza1FAhS5esajKQtbNLsb8qA==","shasum":"d8cdba370091c864e3fe089dd1640afec580bbcb","tarball":"http://registry-npm.ywwl.com/facepaint/download/facepaint-1.2.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFNgqiJ0a7zzzkSVNpeB9hZPu1MGpKSrFvrNzRodRpc9AiEA4yCaTiO4teGHeM+l0Q3ihRke6Sk6Xq99/zv4joq4hWA="}],"size":5403,"noattachment":false,"key":"/facepaint/-/facepaint-1.2.0.tgz"},"maintainers":[{"name":"mitchellhamilton","email":"mitchell@mitchellhamilton.me"},{"name":"tkh44","email":"kye.hohenberger@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/facepaint-1.2.0.tgz_1513884183105_0.4767379288095981"},"directories":{},"readme":"# facepaint\n\n#### Dynamic style values for css-in-js.\n\n```javascript\nimport { css } from 'emotion'\nimport facepaint from 'facepaint'\n\nconst mq = facepaint([\n  '@media(min-width: 420px)',\n  '@media(min-width: 920px)',\n  '@media(min-width: 1120px)'\n])\n\nconst myClassName = css(mq({\n  color: ['red', 'green', 'blue', 'darkorchid'],\n}))\n```\n\n## Install\n\n```bash\nnpm i facepaint -S\n```\n\n**or**\n\n```bash\nyarn add facepaint\n```\n\n## API\n\n#### facepaint `function`\n\n```javascript\nfacepaint(selectors: Array<Selector>) : DynamicStyleFunction\n```\n\n**Arguments**\n* *breakpoints*\n  ```javascript\n  const mq = facepaint([\n    '@media(min-width: 420px)',\n    '@media(min-width: 920px)',\n    '@media(min-width: 1120px)'\n  ])\n  ```\n\n* *options*\n  ```javascript\n  const mq = facepaint(\n    [...],\n    {\n      literal: true|false,\n      overlap: true|false\n    }\n  )\n  ```\n  - literal `boolean` (Default: `false`) - force \"slot\"\n  - overlap `boolean` (Default: `false`) - remove any duplicate values found in multiple \"slots\"\n\n**Returns**\n\n`facepaint` returns a function that can be exported and used throughout\nyour app to dynamically style based on your provided selectors.\n\n- The function accepts any number of arrays or objects as arguments.\n- Nested arrays are flattened.\n- Boolean, `undefined`, and `null` values are ignored.\n\n\n## Examples\n- [emotion](#emotion)\n- [styled-components](#styled-components)\n- [pseudo selectors](#pseudo-selectors)\n\n### emotion\n\n**[CodeSandbox Demo](https://codesandbox.io/s/lxqmwmyzql)**\n\n```javascript\nimport { css } from 'emotion'\nimport facepaint from 'facepaint'\n\nconst mq = facepaint([\n  '@media(min-width: 420px)',\n  '@media(min-width: 920px)',\n  '@media(min-width: 1120px)'\n])\n\nconst myClassName = css(mq({\n  backgroundColor: 'hotpink',\n  textAlign: 'center',\n  width: ['25%', '50%', '75%', '100%'],\n  '& .foo': {\n    color: ['red', 'green', 'blue', 'darkorchid'],\n    '& img': {\n      height: [10, 15, 20, 25]\n    }\n  }\n}))\n```\n\n**Note that the first value is considered a default value and is not a child of a media query at-rule.**\n\n**The following css is generated.**\n\n```css\n.css-rbuh8g {\n  background-color: hotpink;\n  text-align: center;\n  width: 25%;\n}\n\n@media (min-width:420px) {\n  .css-rbuh8g {\n    width: 50%;\n  }\n}\n\n@media (min-width:920px) {\n  .css-rbuh8g {\n    width: 75%;\n  }\n}\n\n@media (min-width:1120px) {\n  .css-rbuh8g {\n    width: 100%;\n  }\n}\n\n.css-rbuh8g .foo {\n  color: red;\n}\n\n@media (min-width:420px) {\n  .css-rbuh8g .foo {\n    color: green;\n  }\n}\n\n@media (min-width:920px) {\n  .css-rbuh8g .foo {\n    color: blue;\n  }\n}\n\n@media (min-width:1120px) {\n  .css-rbuh8g .foo {\n    color: darkorchid;\n  }\n}\n\n.css-rbuh8g .foo img {\n  height: 10px;\n}\n\n@media (min-width:420px) {\n  .css-rbuh8g .foo img {\n    height: 15px;\n  }\n}\n\n@media (min-width:920px) {\n  .css-rbuh8g .foo img {\n    height: 20px;\n  }\n}\n\n@media (min-width:1120px) {\n  .css-rbuh8g .foo img {\n    height: 25px;\n  }\n}\n```\n\n### styled-components\n\n```javascript\nimport styled from 'styled-components'\nimport facepaint from 'facepaint'\n\nconst mq = facepaint([\n  '@media(min-width: 420px)',\n  '@media(min-width: 920px)',\n  '@media(min-width: 1120px)'\n])\n\nconst Div = styled('div')`\n  ${mq({\n    backgroundColor: 'hotpink',\n    textAlign: 'center',\n    width: ['25%', '50%', '75%', '100%'],\n    '& .foo': {\n      color: ['red', 'green', 'blue', 'papayawhip'],\n      '& img': {\n        height: ['10px', '15px', '20px', '25px']\n      }\n    }\n  })};\n`\n\n<Div/>\n```\n\n**The following css is generated.**\n\n```css\n.c0 {\n  background-color: hotpink;\n  text-align: center;\n  width: 25%;\n}\n\n.c0 .foo {\n  color: red;\n}\n\n.c0 .foo img {\n  height: 10px;\n}\n\n@media (min-width:420px) {\n  .c0 {\n    width: 50%;\n  }\n}\n\n@media (min-width:920px) {\n  .c0 {\n    width: 75%;\n  }\n}\n\n@media (min-width:1120px) {\n  .c0 {\n    width: 100%;\n  }\n}\n\n@media (min-width:420px) {\n  .c0 .foo {\n    color: green;\n  }\n}\n\n@media (min-width:920px) {\n  .c0 .foo {\n    color: blue;\n  }\n}\n\n@media (min-width:1120px) {\n  .c0 .foo {\n    color: papayawhip;\n  }\n}\n\n@media (min-width:420px) {\n  .c0 .foo img {\n    height: 15px;\n  }\n}\n\n@media (min-width:920px) {\n  .c0 .foo img {\n    height: 20px;\n  }\n}\n\n@media (min-width:1120px) {\n  .c0 .foo img {\n    height: 25px;\n  }\n}\n```\n\n## Pseudo Selectors\n\n**[CodeSandbox Demo](https://codesandbox.io/s/j5q3m3qy5)**\n\n```javascript\nimport { css } from 'emotion'\nimport facepaint from 'facepaint'\n\nconst pseudo = facepaint([':hover', ':active', ':focus'])\n\nconst myClassName = css(\n  pseudo({\n    backgroundColor: 'hotpink',\n    textAlign: 'center',\n    width: ['25%', '50%', '75%', '100%'],\n    '& .foo': {\n      color: ['red', 'green', 'blue', 'darkorchid'],\n      '& img': {\n        height: [10, 15, 20, 25]\n      }\n    }\n  })\n)\n```\n\n\n```css\n.css-1guvnfu {\n  background-color: hotpink;\n  text-align: center;\n  width: 25%;\n}\n\n.css-1guvnfu:hover {\n  width: 50%;\n}\n\n.css-1guvnfu:active {\n  width: 75%;\n}\n\n.css-1guvnfu:focus {\n  width: 100%;\n}\n\n.css-1guvnfu .foo {\n  color: red;\n}\n\n.css-1guvnfu .foo:hover {\n  color: green;\n}\n\n.css-1guvnfu .foo:active {\n  color: blue;\n}\n\n.css-1guvnfu .foo:focus {\n  color: darkorchid;\n}\n\n.css-1guvnfu .foo img {\n  height: 10px;\n}\n\n.css-1guvnfu .foo img:hover {\n  height: 15px;\n}\n\n.css-1guvnfu .foo img:active {\n  height: 20px;\n}\n\n.css-1guvnfu .foo img:focus {\n  height: 25px;\n}\n```\n","publish_time":1513884183265,"_cnpm_publish_time":1513884183265,"dist-tags":{"latest":"1.2.1"}}