{"id":15043391,"url":"https://github.com/lttb/postjss","last_synced_at":"2025-10-12T07:18:23.513Z","repository":{"id":57339128,"uuid":"82413783","full_name":"lttb/postjss","owner":"lttb","description":"Use the power of PostCSS in compiling with JSS","archived":false,"fork":false,"pushed_at":"2017-06-18T17:38:39.000Z","size":163,"stargazers_count":40,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-09T02:17:48.177Z","etag":null,"topics":["babel","babel-plugin","css-in-js","jss","postcss","styled-components"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lttb.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-18T20:23:42.000Z","updated_at":"2023-09-06T17:42:24.000Z","dependencies_parsed_at":"2022-08-28T10:00:48.042Z","dependency_job_id":null,"html_url":"https://github.com/lttb/postjss","commit_stats":null,"previous_names":["lttb/babel-plugin-prejss"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/lttb/postjss","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lttb%2Fpostjss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lttb%2Fpostjss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lttb%2Fpostjss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lttb%2Fpostjss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lttb","download_url":"https://codeload.github.com/lttb/postjss/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lttb%2Fpostjss/sbom","scorecard":{"id":601364,"data":{"date":"2025-08-11","repo":{"name":"github.com/lttb/postjss","commit":"0732887c1e9a30a001709e24a5f3a7677f3a8e85"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 1/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 3 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"144 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-whgm-jr23-g3j9","Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-832h-xg76-4gv6","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx","Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw","Warn: Project is vulnerable to: GHSA-wxhq-pm8v-cw75","Warn: Project is vulnerable to: GHSA-257v-vj4p-3w2h","Warn: Project is vulnerable to: GHSA-4vmm-mhcq-4x9j","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-p28h-cc7q-c4fg","Warn: Project is vulnerable to: GHSA-9vvw-cc9w-f27h","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-hr2v-3952-633q","Warn: Project is vulnerable to: GHSA-vh7m-p724-62c2","Warn: Project is vulnerable to: GHSA-r9p9-mrjm-926w","Warn: Project is vulnerable to: GHSA-434g-2637-qmqr","Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m","Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw","Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p","Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747","Warn: Project is vulnerable to: GHSA-vjh7-7g9h-fjfh","Warn: Project is vulnerable to: GHSA-4gmj-3p3h-gm8h","Warn: Project is vulnerable to: GHSA-6h5x-7c5m-7cr7","Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc","Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx","Warn: Project is vulnerable to: GHSA-qrmc-fj45-qfc2","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-mpcf-4gmh-23w8","Warn: Project is vulnerable to: GHSA-9qj9-36jm-prpv","Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3","Warn: Project is vulnerable to: MAL-2023-462","Warn: Project is vulnerable to: GHSA-xf7w-r453-m56c","Warn: Project is vulnerable to: GHSA-44pw-h2cw-w3vq","Warn: Project is vulnerable to: GHSA-jp4x-w63m-7wgm","Warn: Project is vulnerable to: GHSA-c429-5p7v-vgjp","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-pfq8-rq6v-vf5m","Warn: Project is vulnerable to: GHSA-6x33-pw7p-hmpq","Warn: Project is vulnerable to: GHSA-c7qv-q95q-8v27","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-4hpf-3wq7-5rpr","Warn: Project is vulnerable to: GHSA-f522-ffg8-j8r6","Warn: Project is vulnerable to: GHSA-7r28-3m3f-r2pr","Warn: Project is vulnerable to: GHSA-r8j5-h5cx-65gg","Warn: Project is vulnerable to: GHSA-mh82-55cm-6gfh","Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546","Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-282f-qqgm-c34q","Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq","Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488","Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g","Warn: Project is vulnerable to: GHSA-fvqr-27wr-82fm","Warn: Project is vulnerable to: GHSA-4xc9-xhrj-v574","Warn: Project is vulnerable to: GHSA-x5rq-j2xg-h7qm","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-pp57-mqmh-44h7","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-wrvr-8mpx-r7pp","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-w9mr-4mfr-499f","Warn: Project is vulnerable to: GHSA-ff6r-5jwm-8292","Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g","Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr","Warn: Project is vulnerable to: GHSA-76c9-3jph-rj3q","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w","Warn: Project is vulnerable to: GHSA-v62p-rq8g-8h59","Warn: Project is vulnerable to: GHSA-566m-qj78-rww5","Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j","Warn: Project is vulnerable to: GHSA-p493-635q-r6gr","Warn: Project is vulnerable to: GHSA-3965-hpx2-q597","Warn: Project is vulnerable to: GHSA-gqgv-6jq5-jjj9","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-hxcm-v35h-mg2x","Warn: Project is vulnerable to: GHSA-6g33-f262-xjp4","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-4rq4-32rv-6wp6","Warn: Project is vulnerable to: GHSA-64g7-mvw6-v9qj","Warn: Project is vulnerable to: GHSA-c9g6-9335-x697","Warn: Project is vulnerable to: GHSA-2m39-62fm-q8r3","Warn: Project is vulnerable to: GHSA-mf6x-7mm4-x2g7","Warn: Project is vulnerable to: GHSA-j44m-qm6p-hp7m","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-g7q5-pjjr-gqvp","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v","Warn: Project is vulnerable to: GHSA-xc7v-wxcw-j472","Warn: Project is vulnerable to: GHSA-662x-fhqg-9p8v","Warn: Project is vulnerable to: GHSA-394c-5j6w-4xmx","Warn: Project is vulnerable to: GHSA-fhg7-m89q-25r3","Warn: Project is vulnerable to: GHSA-pv4c-p2j5-38j4","Warn: Project is vulnerable to: GHSA-46c4-8wrp-j99v","Warn: Project is vulnerable to: GHSA-9m6j-fcg5-2442","Warn: Project is vulnerable to: GHSA-hh27-ffr2-f2jc","Warn: Project is vulnerable to: GHSA-rqff-837h-mm52","Warn: Project is vulnerable to: GHSA-8v38-pw62-9cw2","Warn: Project is vulnerable to: GHSA-hgjh-723h-mx2j","Warn: Project is vulnerable to: GHSA-jf5r-8hm2-f872","Warn: Project is vulnerable to: GHSA-wr3j-pwj9-hqq6","Warn: Project is vulnerable to: GHSA-cf66-xwfp-gvc4","Warn: Project is vulnerable to: GHSA-4v9v-hfq4-rm2v","Warn: Project is vulnerable to: GHSA-9jgg-88mc-972h","Warn: Project is vulnerable to: GHSA-g78m-2chm-r7qv","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp","Warn: Project is vulnerable to: GHSA-h6ch-v84p-w6p9","Warn: Project is vulnerable to: GHSA-q42p-pg8m-cqh6","Warn: Project is vulnerable to: GHSA-w457-6q6x-cgp9","Warn: Project is vulnerable to: GHSA-62gr-4qp9-h98f","Warn: Project is vulnerable to: GHSA-f52g-6jhx-586p","Warn: Project is vulnerable to: GHSA-2cf5-4w76-r9qv","Warn: Project is vulnerable to: GHSA-3cqr-58rm-57f8","Warn: Project is vulnerable to: GHSA-g9r4-xpmj-mj65","Warn: Project is vulnerable to: GHSA-q2c6-c6pm-g3gh","Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44","Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988","Warn: Project is vulnerable to: GHSA-7px7-7xjx-hxm8","Warn: Project is vulnerable to: GHSA-x5pg-88wf-qq4p","Warn: Project is vulnerable to: GHSA-p9wx-2529-fp83","Warn: Project is vulnerable to: GHSA-5v2h-r2cx-5xgj","Warn: Project is vulnerable to: GHSA-rrrm-qjm4-v8hf","Warn: Project is vulnerable to: GHSA-f9cm-qmx5-m98h","Warn: Project is vulnerable to: GHSA-7wpw-2hjm-89gp","Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p","Warn: Project is vulnerable to: GHSA-6394-6h9h-cfjg","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T00:31:45.184Z","repository_id":57339128,"created_at":"2025-08-21T00:31:45.184Z","updated_at":"2025-08-21T00:31:45.184Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279010647,"owners_count":26084784,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["babel","babel-plugin","css-in-js","jss","postcss","styled-components"],"created_at":"2024-09-24T20:48:57.457Z","updated_at":"2025-10-12T07:18:23.468Z","avatar_url":"https://github.com/lttb.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# PostJSS\n\nThis project allows to use PostCSS features (plugins, syntaxes etc.) for compiling to JSS object via babel, so you can take benefits from both.\n\n+ [Advantages](#advantages)\n+ [Installation](#installation)\n+ [Babel Plugin Options](#babel-plugin-options)\n+ [How it works?](#how-it-works)\n  - [As tagged template literal](#as-tagged-template-literal)\n  - [As separate styles file](#as-a-separate-styles-file)\n+ [Custom PostJSS Syntax](#custom-postjss-syntax)\n+ [Hot Module Replacement](#hot-module-replacement)\n+ [Linting](#linting)\n+ [Rebuild optimization](#rebuild-optimization)\n+ [Runtime Usage (sync and async)](#runtime)\n\n## Advantages\n\n- With PostJSS very easy to start using JSS from SASS/SCSS/PostCSS etc. All you need - update your components and use PostJSS Babel Plugin\n- You can continue use your favorite syntax and the power of PostCSS plugins (stylelint, sort-order etc.), but take advantages of CSS in JS - awesome!\n- You can write styles in styled-components way, css-modules way or in both - the choice is yours\n- You can build your project just with babel\n- Static compilation, no runtime overhead!\n- You can use any library that is compatible with the JSS-object, not only JSS\n\n## Installation\n\n```sh\nnpm i postjss -S\n```\n\n\n## Babel Plugin Options\n\nThis plugin uses [postcss-load-config](https://github.com/michael-ciniawsky/postcss-load-config), so you **need** to set **PostCSS options** in *package.json/.postcssrc/postcss.config.js/.postcssrc.js*\n\nPlugin Options:\n\n- `extensionsRe`: `String` - RegExp for extensions. By default `(c|(s[ac]?))ss` - for css, sass, scss, sss\n- `namespace`: `String` - Set your custom namespace for tagged literals. By default its `postjss`\n- `throwError`: `Boolean` - Plugin will throw an error and stop transpiling, if error caused by PostCSS (eg `styling` errors). By default `false`\n\n*.babelrc* example:\n\n```js\nplugins: [\n  [\n    'postjss/babel', {\n      extensionsRe: 's[ac]?ss',\n      namespace: 'customPostJSSNamespace',\n      throwError: false\n    }\n  ]\n]\n```\n\n## How it works?\n\nPlease check the [counter example](https://github.com/lttb/postjss/tree/master/examples/counter)\n\n- [Separate styles example](https://github.com/lttb/postjss/blob/master/examples/counter/src/client/containers/App/index.jsx)\n- [Tagged template literal example](https://github.com/lttb/postjss/blob/master/examples/counter/src/client/components/Counter/index.jsx)\n\n\n![postjss example](https://cloud.githubusercontent.com/assets/11135392/23830255/903ece9c-0717-11e7-8d48-a0b7bf023da9.jpg)\n\n\n### As tagged template literal\n\nBabel PostJSS plugin transforms tagged literal into the JSS-object by PostCSS, like:\n\n```jsx\nconst styles = postjss`\n  .${selector}\n    left: ${() =\u003e 0}\n\n    margin-${marginType}: 10px\n\n    transition: ${'opacity'} 1s\n\n    color: ${color}\n\n    \u0026::before\n      content: '😱'\n`\n```\n\nAfter transpile it would look like:\n```jsx\nconst styles = {\n  [selector]: {\n    left: () =\u003e 0,\n    [`margin-${marginType}`]: '10px',\n    transition: 'opacity 1s',\n    color: color,\n    '\u0026::before': {\n      content: \"'😱'\"\n    }\n  }\n}\n```\n\nYou are free to use all PostCSS feature and custom `postjss syntax` (see bellow)\n\n\u003e Notice that if you are using `stylelint` and `property-no-unknown` rule, you need to set an option like this (it's required for current postjss parser implementation):\n\u003e `property-no-unknown: [true, { ignoreProperties: ['/\\$\\^var__/'] }]`\n\n### As a separate styles file\n\nAfter transpiling imported styles inlined into variable (import name) as a function expression, that accepts an object with arguments and returns a JSS object with styles with arguments usage. Notice that arguments name has uniq scope, so you need not worry about names conflict.\n\nSay you have this *styles.sss* (with SugarSS i.e.):\n\n```stylus\n.lang-list\n  display: flex\n\n  margin: 0\n  padding: 0\n\n  list-style: none\n\n.lang\n  margin-right: 10px\n  padding: 5px\n\n  \u0026.current\n    border-bottom: 1px solid red\n```\n\nAnd a component using it:\n```jsx\nimport style from './style.sss'\n```\n\nAfter babel transpiling your component become as:\n```jsx\nconst styles = function (izexozk) {\n  izexozk = Object.assign({}, izexozk);\n  return {\n    \"langList\": {\n      \"display\": \"flex\",\n      \"margin\": \"0\",\n      \"padding\": \"0\",\n      \"listStyle\": \"none\"\n    },\n    \"lang\": {\n      \"marginRight\": \"10px\",\n      \"padding\": \"5px\",\n      \"\u0026.current\": {\n        \"borderBottom\": \"1px solid red\"\n      }\n    }\n  };\n}\n```\n\nAnd you can use this with JSS like:\n```jsx\ninjectSheet(style())\n```\n\n## Custom PostJSS Syntax\n\nYou can use specific syntax for some JSS-features in your CSS:\n- `/JS Code/` - you can place JS-block wrapped by `/` in every property value\n```stylus\n.app\n  display: /({ visible }) =\u003e visible ? 'block' : 'none'/\n```\n- `$^variableName` - allows you to use variables passed as arguments to the style function\n```stylus\n.app\n  background-color: /^color || $color/\n```\n- `defaults` block for default values - it would be default for accepting args\n```stylus\ndefaults:\n  prop: /^prop || 'test'/\n  selector: ''\n```\n- `$^propertyName` - for custom property/selector names\n```stylus\n.app\n  $^prop: 100vw\n\n$^selector:\n  display: none\n```\n\n## Hot Module Replacement\n\nFor tagged literals HMR supported out of the box. But for separate styles you need to use `postjss hot-loader` with webpack:\nNotice, that you need to set this loader **after** `babel-loader`.\n\n```js\nuse: [\n  'babel-loader',\n  'postjss/webpack/hot-loader',\n]\n```\n\n## Linting\n\nYou can use [stylelint](https://github.com/stylelint/stylelint) for linting and [postcss-reporter](https://github.com/postcss/postcss-reporter) for warnings and errors.\nSo with PostJSS it works like a charm:\n\n### For CSS files:\n\n![sss](https://cloud.githubusercontent.com/assets/11135392/23332790/9ee8325e-fb90-11e6-848d-ce4734814b39.gif)\n\n### For tagged literals:\n\n![postjss](https://cloud.githubusercontent.com/assets/11135392/23332827/1d705f20-fb91-11e6-8b13-146a65cf3ed5.gif)\n\n\n## Rebuild optimization\n\nLet's say you use some tool for linting. But if you set `throwError: true` for `postjss`, it will cause a babel transpilling error, so babel will have to build other files next time, not only fixed.\n\nYou can set `throwError: false` for dev building to avoid this, and use `postjss report-loader` for webpack (set this loader **before** `babel-loader`:\n\n```js\nuse: [\n  'postjss/webpack/report-loader',\n  'babel-loader',\n]\n```\n\nThis will break webpack compiling if there are some errors in PostJSS, but not babel transpiling. And then babel needs to rebuild only fixed file.\n\n## Runtime\n\nYou can use this module in runtime without babel-plugin.\n- it works just on node.js\n- you can use async and sync versions, so async is more preferable, because sync is blocking your process\n- and it may cause some performance issues\n\nSo I recommend this usage only for tests and first steps :)\n\nSync version:\n\n```jsx\nimport postjss from 'postjss'\n\nconsole.log(postjss`\n  .app\n    color: red\n`)\n\n// output: { app: { color: 'red' } }\n```\n\nAsync version:\n```jsx\nimport postjssAsync from 'postjss/runtime/async'\n\n;(async () =\u003e {\n  const postjss = await postjssAsync\n\n  console.log(await postjss`\n    .app\n      color: red\n  `)\n\n  // output: { app: { color: 'red' } }\n})()\n\n```\n\nYou may also be interested in this project for runtime usage: [jss-from-postcss](https://github.com/axept/jss-from-postcss)\n\n## Full Example\n\n*style.sss*\n```stylus\n@import 'vars.sss'\n@import 'mixins.sss'\n\n$color: 'green'\n\n:root\n  --color: $color\n\ndefaults:\n  prop: /$^prop || 'test'/\n  selector: ''\n\n.app\n  position: absolute\n  top: 0\n  left: 0\n\n  display: /({ name }) =\u003e name + 1 + $color-from-import/\n  overflow-y: auto\n  flex-direction: column\n\n  width: 100vw\n  height: 100vh\n\n  color: var(--color)\n  background-color: /$^value || $color/\n\n  $^prop: 100vw\n\n$^selector:\n  display: none\n\n.content\n  @mixin container\n\n  padding: 20px\n\n.header\n  border-bottom: 1px solid #eee\n```\n\n*component.jsx*\n```jsx\nconst style = function (izezix) {\n  izezix = Object.assign({\n    \"prop\": izezix.prop || 'test',\n    \"selector\": \"''\"\n  }, izezix);\n  return {\n    \"app\": {\n      \"position\": \"absolute\",\n      \"top\": \"0\",\n      \"left\": \"0\",\n      \"display\": function ({\n        name\n      }) {\n        return name + 1 + 'black';\n      },\n      \"overflowY\": \"auto\",\n      \"flexDirection\": \"column\",\n      \"width\": \"100vw\",\n      \"height\": \"100vh\",\n      \"color\": \"green\",\n      \"backgroundColor\": izezix.value || 'green',\n      [izezix.prop]: \"100vw\"\n    },\n    [izezix.selector]: {\n      \"display\": \"none\"\n    },\n    \"content\": {\n      \"position\": \"absolute\",\n      \"margin\": \"0 auto\",\n      \"\u0026::before\": {\n        \"content\": \"''\"\n      },\n      \"padding\": \"20px\"\n    },\n    \"header\": {\n      \"borderBottom\": \"1px solid #eee\"\n    }\n  };\n}\n```\n\n## Links\n\n* [JSS](https://github.com/cssinjs/jss) - Great lib for CSS in JS\n* [PostCSS](https://github.com/postcss/postcss) - Awesome tool for customizable style transform\n\n## License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flttb%2Fpostjss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flttb%2Fpostjss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flttb%2Fpostjss/lists"}