{"id":13462894,"url":"https://github.com/sabeurthabti/react-native-css","last_synced_at":"2025-03-25T06:31:23.282Z","repository":{"id":30671435,"uuid":"34227243","full_name":"thabti/react-native-css","owner":"thabti","description":"Style React-Native components with css","archived":true,"fork":false,"pushed_at":"2020-01-27T06:57:34.000Z","size":261,"stargazers_count":769,"open_issues_count":12,"forks_count":66,"subscribers_count":24,"default_branch":"master","last_synced_at":"2025-03-15T04:23:21.018Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thabti.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-19T22:43:11.000Z","updated_at":"2024-03-21T17:13:26.000Z","dependencies_parsed_at":"2022-09-08T16:02:31.570Z","dependency_job_id":null,"html_url":"https://github.com/thabti/react-native-css","commit_stats":null,"previous_names":["sabeurthabti/react-native-css"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thabti%2Freact-native-css","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thabti%2Freact-native-css/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thabti%2Freact-native-css/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thabti%2Freact-native-css/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thabti","download_url":"https://codeload.github.com/thabti/react-native-css/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245413749,"owners_count":20611353,"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","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-07-31T13:00:40.405Z","updated_at":"2025-03-25T06:31:23.004Z","avatar_url":"https://github.com/thabti.png","language":"JavaScript","readme":"\n\n\n# react-native-css [![Circle CI](https://circleci.com/gh/sabeurthabti/react-native-css.svg?style=svg\u0026circle-token=a140907997e6a37c6c5ec75f04e8150cef049ff6)](https://circleci.com/gh/sabeurthabti/react-native-css) [![NPM](https://img.shields.io/npm/dm/react-native-css.svg?style=flat-square)](https://www.npmjs.com/package/react-native-css)\n\n\u003e React-native-css turns valid CSS into the Facebook subset of CSS.\n\n# Babel-plugin\n The awesome @danilosterrapid7 create a babel-plugin for React-native-css:\n\nhttps://www.npmjs.com/package/babel-plugin-react-native-sass-classname\n\n## Version 2 \nWith version 2 come new changes:\n\n- Remove sass/scss support, this is a huge overhead for little benefit. \n- No CLI, we believe that this is an unnecessary context switch\n- NO I/O, no longer writing files, we do everything at runtime.  \n\n\u003e if you still want access to the the old implementation, please check `v1` branch. \n\n## Install\n\n```bash\nyarn add react-native-css\n```\n\n```bash\nnpm install react-native-css --save\n```\n\n\n# Example\n\nGiven the following CSS:\n\n``` js\nimport RNC from 'react-native-css';\n\nRNC`\n  description {\n    margin-bottom: 20px;\n    font-size: 18px;\n    text-align: center;\n    color: #656656;\n  }\n\n  container {\n    padding: 30px;\n    margin-top: 65px;\n    align-items: center;\n    display: block;\n  }\n`\n\n```\n\nReact-native-css will generate to the following:\n\n``` javascript\n{\"description\":{\"marginBottom\":20,\"fontSize\":18,\"textAlign\":\"center\",\"color\":\"#656656\"},\"container\":{\"padding\":30,\"marginTop\":65,\"alignItems\":\"center\"}}\n```  \n# Usage\n```js\nimport RNC from 'react-native-css';\n\nclass SearchPage extends Component {\n  render() {\n    const { color, fontSize } = this.props;\n      const styles = RNC`\n        description {\n          margin-bottom: 20px;\n          font-size: ${fontSize}\n          text-align: center;\n          color: ${color}\n        }\n\n        container {\n          padding: 30px;\n          margin-top: 65px;\n          align-items: center;\n          display: block;\n        }\n      `;\n\n    return (\n      \u003cView style={styles.container}\u003e\n        \u003cText style={styles.description}\u003e\n            Search!\n        \u003c/Text\u003e\n      \u003c/View\u003e\n    );\n  }\n}\n\n```\n","funding_links":[],"categories":["Components","组件","JavaScript","动画","Index"],"sub_categories":["Styling","工具包","其他"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsabeurthabti%2Freact-native-css","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsabeurthabti%2Freact-native-css","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsabeurthabti%2Freact-native-css/lists"}