{"id":17963334,"url":"https://github.com/kristerkari/react-native-stylus-transformer","last_synced_at":"2026-03-06T07:31:54.574Z","repository":{"id":31817112,"uuid":"127810095","full_name":"kristerkari/react-native-stylus-transformer","owner":"kristerkari","description":"Use Stylus to style your React Native apps.","archived":false,"fork":false,"pushed_at":"2024-05-16T09:01:07.000Z","size":345,"stargazers_count":11,"open_issues_count":1,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-27T09:49:46.159Z","etag":null,"topics":["loader","react-native","stylus","transform"],"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/kristerkari.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-02T20:41:35.000Z","updated_at":"2025-05-27T06:56:39.000Z","dependencies_parsed_at":"2024-05-17T19:46:22.561Z","dependency_job_id":null,"html_url":"https://github.com/kristerkari/react-native-stylus-transformer","commit_stats":{"total_commits":40,"total_committers":4,"mean_commits":10.0,"dds":0.275,"last_synced_commit":"4d7c1da5b941c57c4fe5bd667eb88cba609ddac3"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/kristerkari/react-native-stylus-transformer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristerkari%2Freact-native-stylus-transformer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristerkari%2Freact-native-stylus-transformer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristerkari%2Freact-native-stylus-transformer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristerkari%2Freact-native-stylus-transformer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kristerkari","download_url":"https://codeload.github.com/kristerkari/react-native-stylus-transformer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristerkari%2Freact-native-stylus-transformer/sbom","scorecard":{"id":570229,"data":{"date":"2025-08-11","repo":{"name":"github.com/kristerkari/react-native-stylus-transformer","commit":"ef4fd46c03029f0127ac54dd630ba9b1ae5912ac"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.4,"checks":[{"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":"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":"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":"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":"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":"Code-Review","score":0,"reason":"Found 0/6 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":"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 26 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":5,"reason":"5 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6"],"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-20T16:08:48.385Z","repository_id":31817112,"created_at":"2025-08-20T16:08:48.385Z","updated_at":"2025-08-20T16:08:48.385Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30165622,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T04:43:31.446Z","status":"ssl_error","status_checked_at":"2026-03-06T04:40:30.133Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["loader","react-native","stylus","transform"],"created_at":"2024-10-29T11:33:45.027Z","updated_at":"2026-03-06T07:31:54.517Z","avatar_url":"https://github.com/kristerkari.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-stylus-transformer [![NPM version](http://img.shields.io/npm/v/react-native-stylus-transformer.svg)](https://www.npmjs.org/package/react-native-stylus-transformer) [![Downloads per month](https://img.shields.io/npm/dm/react-native-stylus-transformer.svg)](http://npmcharts.com/compare/react-native-stylus-transformer?periodLength=30) [![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg)](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github)\n\nUse [Stylus](https://github.com/stylus/stylus) to style your React Native apps.\n\nBehind the scenes the `.styl` files are transformed to [react native style objects](https://facebook.github.io/react-native/docs/style.html) (look at the examples).\n\n\u003e This transformer can be used together with [React Native CSS modules](https://github.com/kristerkari/react-native-css-modules).\n\n## How does it work?\n\nYour `App.styl` file might look like this:\n\n```css\n.myClass {\n  color: blue;\n}\n.myOtherClass {\n  color: red;\n}\n.my-dashed-class {\n  color: green;\n}\n```\n\nWhen you import your stylesheet:\n\n```js\nimport styles from \"./App.styl\";\n```\n\nYour imported styles will look like this:\n\n```js\nvar styles = {\n  myClass: {\n    color: \"blue\"\n  },\n  myOtherClass: {\n    color: \"red\"\n  },\n  \"my-dashed-class\": {\n    color: \"green\"\n  }\n};\n```\n\nYou can then use that style object with an element:\n\n**Plain React Native:**\n\n```jsx\n\u003cMyElement style={styles.myClass} /\u003e\n\n\u003cMyElement style={styles[\"my-dashed-class\"]} /\u003e\n```\n\n**[React Native CSS modules](https://github.com/kristerkari/react-native-css-modules) using [className](https://github.com/kristerkari/babel-plugin-react-native-classname-to-style) property:**\n\n```jsx\n\u003cMyElement className={styles.myClass} /\u003e\n\n\u003cMyElement className={styles[\"my-dashed-class\"]} /\u003e\n```\n\n**[React Native CSS modules](https://github.com/kristerkari/react-native-css-modules) using [styleName](https://github.com/kristerkari/babel-plugin-react-native-stylename-to-style) property:**\n\n```jsx\n\u003cMyElement styleName=\"myClass my-dashed-class\" /\u003e\n```\n\n## Installation and configuration\n\n### Step 1: Install\n\n```sh\nnpm install --save-dev react-native-stylus-transformer stylus\n```\n\nor\n\n```sh\nyarn add --dev react-native-stylus-transformer stylus\n```\n\n### Step 2: Configure the react native packager\n\n#### For Expo SDK v41.0.0 or newer\n\nMerge the contents from your project's `metro.config.js` file with this config (create the file if it does not exist already).\n\n`metro.config.js`:\n\n```js\nconst { getDefaultConfig } = require(\"expo/metro-config\");\n\nmodule.exports = (() =\u003e {\n  const config = getDefaultConfig(__dirname);\n\n  const { transformer, resolver } = config;\n\n  config.transformer = {\n    ...transformer,\n    babelTransformerPath: require.resolve(\"react-native-stylus-transformer\")\n  };\n  config.resolver = {\n    ...resolver,\n    sourceExts: [...sourceExts, \"styl\"]\n  };\n\n  return config;\n})();\n```\n\n---\n\n#### For React Native v0.72.1 or newer\n\nMerge the contents from your project's `metro.config.js` file with this config (create the file if it does not exist already).\n\n`metro.config.js`:\n\n```js\nconst { getDefaultConfig, mergeConfig } = require(\"@react-native/metro-config\");\n\nconst defaultConfig = getDefaultConfig(__dirname);\nconst { assetExts, sourceExts } = defaultConfig.resolver;\n\n/**\n * Metro configuration\n * https://reactnative.dev/docs/metro\n *\n * @type {import('metro-config').MetroConfig}\n */\nconst config = {\n  transformer: {\n    babelTransformerPath: require.resolve(\"react-native-stylus-transformer\")\n  },\n  resolver: {\n    sourceExts: [...sourceExts, \"styl\"]\n  }\n};\n\nmodule.exports = mergeConfig(defaultConfig, config);\n```\n\n## CSS Custom Properties (CSS variables)\n\n_You need version 1.2.0 or newer_\n\n```css\n:root {\n  --text-color: blue;\n}\n\n.blue {\n  color: var(--text-color);\n}\n```\n\nCSS variables are not supported by default, but you can add support for them by using [PostCSS](https://postcss.org/) and [postcss-css-variables](https://github.com/MadLittleMods/postcss-css-variables#readme) plugin.\n\nStart by installing dependencies:\n\n```sh\nnpm install postcss postcss-css-variables react-native-postcss-transformer --save-dev\n```\n\nor\n\n```sh\nyarn add postcss postcss-css-variables react-native-postcss-transformer --dev\n```\n\nAdd `postcss-css-variables` to your PostCSS configuration with [one of the supported config formats](https://github.com/michael-ciniawsky/postcss-load-config), e.g. `package.json`, `.postcssrc`, `postcss.config.js`, etc.\n\nAfter that create a `transformer.js` file and do the following:\n\n```js\nconst upstreamTransformer = require(\"@react-native/metro-babel-transformer\");\nconst stylusTransformer = require(\"react-native-stylus-transformer\");\nconst postCSSTransformer = require(\"react-native-postcss-transformer\");\n\nmodule.exports.transform = function({ src, filename, ...rest }) {\n  if (filename.endsWith(\".styl\")) {\n    return stylusTransformer\n      .renderToCSS({ src, filename, options })\n      .then(css =\u003e\n        postCSSTransformer.transform({ src: css, filename, ...rest })\n      );\n  } else {\n    return upstreamTransformer.transform({ src, filename, ...rest });\n  }\n};\n```\n\nAfter that in `metro.config.js` point the `babelTransformerPath` to that file:\n\n```diff\n-require.resolve(\"react-native-stylus-transformer\")\n+require.resolve(\"./transformer.js\")\n```\n\n## Dependencies\n\nThis library has the following Node.js modules as dependencies:\n\n- [css-to-react-native-transform](https://github.com/kristerkari/css-to-react-native-transform)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkristerkari%2Freact-native-stylus-transformer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkristerkari%2Freact-native-stylus-transformer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkristerkari%2Freact-native-stylus-transformer/lists"}