{"id":4542,"url":"https://github.com/blackmiaool/rn-less","last_synced_at":"2025-08-31T15:07:14.927Z","repository":{"id":80035208,"uuid":"100601618","full_name":"blackmiaool/rn-less","owner":"blackmiaool","description":"Style react-native with less.","archived":false,"fork":false,"pushed_at":"2017-11-14T02:49:34.000Z","size":145,"stargazers_count":19,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-14T02:57:01.889Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blackmiaool.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-08-17T12:34:11.000Z","updated_at":"2022-03-04T12:53:25.000Z","dependencies_parsed_at":"2023-03-31T11:48:43.937Z","dependency_job_id":null,"html_url":"https://github.com/blackmiaool/rn-less","commit_stats":{"total_commits":70,"total_committers":1,"mean_commits":70.0,"dds":0.0,"last_synced_commit":"f1b3ea813b2018752a7201cf50b45781a3439ea2"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/blackmiaool/rn-less","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blackmiaool%2Frn-less","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blackmiaool%2Frn-less/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blackmiaool%2Frn-less/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blackmiaool%2Frn-less/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blackmiaool","download_url":"https://codeload.github.com/blackmiaool/rn-less/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blackmiaool%2Frn-less/sbom","scorecard":{"id":242236,"data":{"date":"2025-08-11","repo":{"name":"github.com/blackmiaool/rn-less","commit":"f1b3ea813b2018752a7201cf50b45781a3439ea2"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.3,"checks":[{"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"Code-Review","score":0,"reason":"Found 0/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":"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":"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":"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":"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":"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":"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":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"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":"Vulnerabilities","score":0,"reason":"48 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-8w4h-3cm3-2pm2","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-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-qrmc-fj45-qfc2","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","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-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","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-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-2m96-9w4j-wgv7","Warn: Project is vulnerable to: GHSA-h726-x36v-rx45","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-wrvr-8mpx-r7pp","Warn: Project is vulnerable to: GHSA-hxm2-r34f-qmc5","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-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","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-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"],"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-17T06:52:50.771Z","repository_id":80035208,"created_at":"2025-08-17T06:52:50.772Z","updated_at":"2025-08-17T06:52:50.772Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272814767,"owners_count":24997620,"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-08-30T02:00:09.474Z","response_time":77,"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":[],"created_at":"2024-01-05T20:17:15.742Z","updated_at":"2025-08-31T15:07:14.872Z","avatar_url":"https://github.com/blackmiaool.png","language":"JavaScript","funding_links":[],"categories":["Components"],"sub_categories":["Styling"],"readme":"# rn-less\n\nStyle react-native with less.\n\nPowered by [react-native-css](https://github.com/sabeurthabti/react-native-css) and [less.js](http://lesscss.org/).\n\n### Example\n\n``` less\nrn-config{//style's config\n    arguments: containerMargin,bgColor;//arguments used in less\n}\nCardExampleStyle {\n    .render-title{\n        flex: 1;\n        align-items: center;\n        margin-top: 20;\n        .title-text{\n            font-size: 20\n        }\n    }\n    .container {\n        flex: 1;\n        margin-top: containerMargin;// use the variable declared above\n        margin-bottom: \"containerMargin\";// use the variable with string\n        .title {\n            font-size: \"containerMargin/2\";// and any expression starts with variable name\n            background-color: bgColor;\n        }\n    }\n}\n```\n\n```jsx\nimport { rnLess } from 'rn-less/src/runtime';// import the decorator\nimport style from './a.less.js'; // import the style\n\nconst rootStyle = style({containerMargin,bgColor});// pass your arguments and get the style object\n\n//decorate the component with the style\n//write the decorator in this a.b way to let the vscode extention track the style\n@rnLess(rootStyle.CardExampleStyle)\nclass CardExample extends Component {\n    //the strings in the style attribute are the class names in the less file\n    _renderTitle(title) {\n        // function invoking is processed, but stateless is not\n        return (\n            \u003cView style=\"render-title\"\u003e\n                \u003cText style=\"title-text\"\u003e{title}\u003c/Text\u003e\n            \u003c/View\u003e\n        )\n    }\n\n    render() {\n        return (\n            \u003cScrollView\u003e\n                \u003cView style=\"container\"\u003e                    \n                    {this._renderTitle('Basic')}\n                    \u003cCard\u003e\n                        \u003cCardTitle\u003e\n                            \u003cText style={[\"title\"]}\u003eCard Title\u003c/Text\u003e\n                        \u003c/CardTitle\u003e\n                    \u003c/Card\u003e\n                \u003c/View\u003e\n            \u003c/ScrollView\u003e\n        )\n    }\n}\n```\n\n## How to use it\n\n#### Install things\n```bash\n# enter the root directory of the project\nnpm i -S rn-less\ncp -i node_modules/rn-less/example/gulpfile.js .\nnpm i -g gulp\n\n```\n#### Modify the gulpfile.js\n```javascript\n// change it to your source folder\nconst sourceDir='./app';\n```\n#### Notice\n\nAll the styles in a component with the same className would be combined into a single one. It ignores the hierarchy of the less file. The hierarchy in the less file is just for you, not for rn-less.\n\n\n#### Run the gulp\n```bash\ngulp\n```\n#### Create your less file and import it in a js/jsx file\n\n```javascript\nimport { rnLess } from 'rn-less/src/runtime';// import the decorator\nimport style from './a.less.js'; // import the style\n\nconst rootStyle = style({containerMargin,bgColor});// pass your arguments and get the style object\n\n//decorate the component with the style\n@rnLess(rootStyle.CardExampleStyle)\nclass CardExample extends Component {}\n```\n\n## What's more\n\n#### Process the less output\n\n```javascript\ncode = processStyleobject({\n    code,\n    hierarchy: false,\n    custom: function ({\n        root,\n        traverseProperty,\n        traverseStyle,\n        traverseChunk\n    }) {\n        // font-size:10 -\u003e fontSize:Theme.font10\n        traverseProperty(root, function ({ value, property, selector }) {\n            if (property === 'fontSize') {\n                return `Theme.font${value}`;\n            }\n        });\n\n        // sort the keys \n        traverseStyle(root, function ({ style, selector, chunk, component }) {\n            const ret = {};\n            Object.keys(style).sort().forEach((key) =\u003e {\n                ret[key] = style[key];\n            });\n            return ret;\n        });\n\n        //print the chunks\n        traverseChunk(root, function ({ chunk, styleName, component }) {\n            console.log(chunk);\n        });\n    }\n});\n```\n\n#### Enjoy the vscode extension\n\n[https://github.com/blackmiaool/rn-less-helper](https://github.com/blackmiaool/rn-less-helper)\n\u003cp align=\"center\"\u003e      \n    \u003cimg width=\"600\" src=\"https://raw.githubusercontent.com/blackmiaool/rn-less-helper/master/function.gif\"\u003e  \n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblackmiaool%2Frn-less","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblackmiaool%2Frn-less","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblackmiaool%2Frn-less/lists"}