{"name":"aphrodite-jss","description":"Aphrodite-like API on top of JSS.","version":"2.1.0","scripts":{"all":"npm run lint && npm run build","clean":"rm -fr ./lib/*","build":"npm run clean && npm run build:lib && npm run build:max && npm run build:min","build:lib":"cross-env babel src --out-dir lib","build:max":"cross-env NODE_ENV=development webpack src/index.js dist/aphrodite-jss.js","build:min":"cross-env NODE_ENV=production webpack src/index.js dist/aphrodite-jss.min.js","lint":"eslint ./src ./tests ./benchmark ./*.js","lint:staged":"lint-staged","prepublish":"npm run all","test":"cross-env BABEL_ENV=test jest ./test"},"author":{"name":"Oleg Slobodskoi","email":"oleg008@gmail.com"},"repository":{"type":"git","url":"git+ssh://git@github.com/cssinjs/aphrodite-jss.git"},"keywords":["jss","cssinjs","css-in-js","aphrodite","react"],"license":"MIT","main":"./lib/index.js","engines":{"node":">=4.0.0"},"devDependencies":{"babel-cli":"^6.5.1","babel-core":"^6.5.1","babel-eslint":"^7.1.1","babel-loader":"^7.0.0","babel-plugin-inline-version":"^1.0.2","babel-plugin-transform-es3-member-expression-literals":"^6.8.0","babel-plugin-transform-es3-property-literals":"^6.22.0","babel-preset-es2015":"^6.5.0","babel-preset-stage-0":"^6.5.0","cross-env":"^5.0.0","es5-shim":"^4.3.1","eslint":"^3.0.1","eslint-config-airbnb":"^13.0.0","eslint-config-jss":"^3.0.0","eslint-plugin-import":"2.2.0","eslint-plugin-jsx-a11y":"^2.2.3","eslint-plugin-react":"^6.5.0","jest":"^23.4.1","json-loader":"^0.5.4","lint-staged":"^3.4.2","pre-commit":"^1.2.0","webpack":"^2.5.1"},"dependencies":{"jss":"^8.1.0","jss-preset-default":"^3.0.0","murmurhash-js":"^1.0.0"},"lint-staged":{"./src ./tests ./benchmark ./*.js":["eslint","git add"]},"gitHead":"19f1c82e834bac9cb63b7ce10eecb0a6bc36a863","bugs":{"url":"https://github.com/cssinjs/aphrodite-jss/issues"},"homepage":"https://github.com/cssinjs/aphrodite-jss#readme","_id":"aphrodite-jss@2.1.0","_npmVersion":"5.6.0","_nodeVersion":"8.11.3","_npmUser":{"name":"kof","email":"oleg008@gmail.com"},"dist":{"integrity":"sha512-25gINvLunuuVbegcnkLTXcCGKN/xeuVSW+Gl5elV5DhUeT+ueIpTghdyjaXmpiklzrQjXKZGSWbic+33DM+Q0A==","shasum":"62961a715130de29f064401fb8fb89b2bee830e9","tarball":"http://registry-npm.ywwl.com/aphrodite-jss/download/aphrodite-jss-2.1.0.tgz","fileCount":19,"unpackedSize":1156750,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbVJWNCRA9TVsSAnZWagAA9CQP/33py9rIS0Op2PGMZpCS\nzUiNEH8kzs+HEJGgxLPdkdCv8v5EqJXM+aRIyVbcu/gIZau2BLU/3EW2qax/\n5Q+aJPKzQijE7Z8jXqsQrcahCM+ERDg45TcUNi3PUUnStadAHh89A9YWF9OT\n4nXlpt9S6pPZ1Bfgdlfa7aJgQxBCgqPG6dGJ0pclXFphAnd1CBnGTRbQyc2x\nNRC5zbIJFSXZQtMSGArayfqXVcLz/etnoACdheXTsQnkjDa84kC3cjrSM0E6\nIIfmIhtiYwA2O1WVg3a/w2FvaEIe3BrbekXhyy+tLIdqv6EupVVR7obkPM4l\nxwlANy11QVPPhYxTN2LssN6UurHb7msTCQGZyDa60FQoZbtR3/vsFoQ6XNMN\nX3ZhbziHyWB+TAXJ7a9JQz924Frtq2j7zVGAvxKpsV2li4Ap0O5lUrJXi3Un\nPVTQLrrilbQ//M3NuvcHs5FG8jkev0l63CjSrn7n5N5bvetfxPuWXtP4JaAY\n3Cc8+f7m2zYSNEzV6FnMWhcTuwwnFLJ5SXfZCifWGJR4FbbnCLaUXkNCsg/c\njffrMH2c9jHBwj2mKfwAoqP50pG1Aj0DbdbHgCiVquckOMBOzCGyKtUnl5CZ\nbscGVZX1SwWvgqWV7BAK+MkfdhWJ91glm309T+BrAB2JGAd2mJZVcqPWu3T3\npleu\r\n=Mdoe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBH+ZzRBbH/iuKV0f1hViw0YvEP0vFBVltb58YcwiiBTAiBRNjqtFDlJYdA1FeUEO6UmZKP5E1oK+2jQla9VOEHwQQ=="}],"size":232560,"noattachment":false,"key":"/aphrodite-jss/-/aphrodite-jss-2.1.0.tgz"},"maintainers":[{"name":"kof","email":"oleg008@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/aphrodite-jss_2.1.0_1532269965573_0.9328106671474863"},"_hasShrinkwrap":false,"readme":"# Aphrodite-like API on top of JSS.\n\nThis project is a merge of good ideas from [aphrodite](https://github.com/Khan/aphrodite) and [JSS](https://github.com/cssinjs/jss). It provides an API of aphrodite but fixes lots of limitations and caveats by using JSS as a rendering engine under the hood.\n\n## Good parts from aphrodite.\n\n- Pretty much like inline styles known from React, except it allows to use the entire CSS.\n- No CSS is generated until `css()` function invocation. Only the passed rules are converted to a CSS string and injected.\n- Theming is possible without any headache or framework integrations.\n\n## Benefits compared to aphrodite.\n\n- More powerfull rendering abstraction through [JSS](https://github.com/cssinjs/jss) under the hood. You are using all it's plugins and [JSON DSL](https://github.com/cssinjs/jss/blob/master/docs/json-api.md). To name a few:\n  - Children, siblings and any other kinds of selectors. ([jss-nested](https://github.com/cssinjs/jss-nested))\n  - Global styles, without auto namespacing ([jss-global](https://github.com/cssinjs/jss-global)).\n- Immediate render upon `css()` call invocation. It gives you an access to computed styles right after render, no need to use `setTimeout()`. It also avoids additional recalcs and repaints, which can cause flickers and general performance overhead.\n- No auto \"!important\" insertion. You can write a plugin for this though.\n\n\n## Example\n\n```javascript\nimport {StyleSheet, css} from 'aphrodite-jss'\n\nconst sheet = StyleSheet.create({\n  button: {\n    border: '1px solid',\n    borderRadius: 5,\n    fontSize: 'inherit',\n    lineHeight: '2.3em',\n    padding: '0 1em',\n    boxShadow: 'inset 0 1px 0 rgba(255, 255, 255, 0.1)',\n    textShadow: '0 -1px 0 rgba(0, 0, 0, 0.25)',\n    backgroundRepeat: 'repeat-x',\n    color: '#fff',\n    fontWeight: 400,\n    '& span': {\n      marginRight: 5,\n      color: '#fff'\n    }\n  },\n  primary: {\n    borderColor: '#1177cd #0f6ab6 #0d5c9e',\n    backgroundImage: 'linear-gradient(to bottom, #2591ed 0%, #1177cd 100%)',\n    backgroundColor: '#1385e5',\n    '&:hover': {\n      backgroundImage: 'linear-gradient(to bottom, #3c9def 0%, #1385e5 100%)'\n    }\n  }\n})\n\ndocument.body.innerHTML = `\n  <button class=\"${css(sheet.button, sheet.primary)}\">\n    <span>&#10004;</span>Primary\n  </button>\n`\n```\n\n## API\n\n### Create style sheet.\n\n`StyleSheet.create(styles)`\n\nCreate function doesn't render anything, it just registers your styles.\n\nReturns an object, where key names correspond the original styles obejct.\n\n### Inject rules.\n\n`css(rule1, [rule2], [rule3], ...)`\n\nInjects a previously defined rule to the dom. This is done in sync, so the CSS rule is immediately available.\n\nReturns a class name.\n\n### Styles format.\n\nThe format for styles is defined in [jss](https://github.com/cssinjs/jss/blob/master/docs/json-api.md). Aprodisiac uses [jss-preset-default](https://github.com/cssinjs/jss-preset-default), so all default presets are already in place.\n\n### Customizing JSS.\n\n`aphroditeJss(jss, [options])`\n\nYou can pass your own JSS instance with your custom setup.\n\nReturns aphrodite's interface.\n\n```javascript\nimport aphroditeJss from 'aphrodite-jss'\nimport {create} from 'jss'\n\nconst {css, StyleSheet} = aphroditeJss(create())\n```\n\n### Serverside Rendering.\n\nThere are 2 functions you need to know - `toString()` and `reset()`.\nAs aphrodite-jss can not know that you are rendering a new response, you need to get the CSS (`toString()`) when you are processing the first request and call `reset()` to clean up the styles your current page has produced.\n\n\n```javascript\nimport {toString, reset} from 'aphrodite-jss'\n\nfunction render() {\n  const app = renderApp()\n  const css = toString()\n  reset()\n\n  return `\n    <head>\n      <style>\n        ${css}\n      </style>\n    <head>\n    <body>\n      ${app}\n    </body>\n  `\n}\n```\n\n## License\n\nMIT\n","publish_time":1532269965705,"_cnpm_publish_time":1532269965705,"dist-tags":{"latest":"2.1.0"}}