{"id":17651613,"url":"https://github.com/mohit23x/react-native-sugar-style","last_synced_at":"2025-05-07T08:02:30.457Z","repository":{"id":38982395,"uuid":"332484134","full_name":"mohit23x/react-native-sugar-style","owner":"mohit23x","description":"React Native Stylesheet alternative with theme support","archived":false,"fork":false,"pushed_at":"2023-03-01T23:57:08.000Z","size":762,"stargazers_count":9,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-07T08:02:08.674Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://sugar-style.netlify.app/","language":"TypeScript","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/mohit23x.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2021-01-24T15:28:08.000Z","updated_at":"2024-06-27T06:01:02.000Z","dependencies_parsed_at":"2025-03-10T21:31:11.258Z","dependency_job_id":"57531738-a7f0-442f-875e-bab94262f304","html_url":"https://github.com/mohit23x/react-native-sugar-style","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohit23x%2Freact-native-sugar-style","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohit23x%2Freact-native-sugar-style/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohit23x%2Freact-native-sugar-style/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohit23x%2Freact-native-sugar-style/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mohit23x","download_url":"https://codeload.github.com/mohit23x/react-native-sugar-style/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252839277,"owners_count":21812085,"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-10-23T11:42:48.917Z","updated_at":"2025-05-07T08:02:30.411Z","avatar_url":"https://github.com/mohit23x.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"left\"\u003e\n\n    🚀React Native Sugar Style\n\n\u003c/h1\u003e\n\nhttps://www.npmjs.com/package/react-native-sugar-style (🧪 Experimental)\n\n\u003cbr /\u003e\n\n🎨 Theme based alternative for React Native StyleSheet\n\n✨ Support responsive values as array\n\n📐 Reduce computing device height \u0026 width in every component\n\n📱 Works on android/ios/web (expo/react-native)\n\n## Install\n\n```\nyarn add react-native-sugar-style\n```\n\n```\nnpm i react-native-sugar-style\n```\n\n## Usage\n\nSTEP 1: **style.tsx**\n\nDefine configurations for your theme, for more verbose example see [this file](https://github.com/mohit23x/react-native-sugar-style/blob/main/example/style/index.tsx).\n\n```typescript\nimport Sugar from \"react-native-sugar-style\";\n\nconst dark = {\n  background: \"#2b2b2b\",\n  text: \"#ffffff\",\n};\n\nconst light = {\n  background: \"#fbfbfb\",\n  text: \"#000000\",\n};\n\nexport const { StyleSheet } = Sugar(light);\n\nexport default StyleSheet;\n```\n\n\u003cbr /\u003e\n\nSTEP 2: **component.tsx**\n\nUse StyleSheet as you do normally do in components\n\n```javascript\nimport React from \"react\";\nimport { View, Text } from \"react-native\";\nimport { StyleSheet } from \"./style\";\n\nconst Component = () =\u003e {\n  return (\n    \u003cView style={styles.container}\u003e\n      \u003cText style={styles.text}\u003eHello World\u003c/Text\u003e\n    \u003c/View\u003e\n  );\n};\n\nconst styles = StyleSheet.create((theme, constants) =\u003e ({\n  container: {\n    height: constants.height,\n    width: constants.width,\n    backgroundColor: theme.background,\n    flexDirection: [\"column\", \"row\"],\n  },\n  text: {\n    color: theme.text,\n  },\n}));\n```\n\n\u003cbr /\u003e\n\n## Demo\n\nScan and run with expo go app, run the [example project](https://github.com/mohit23x/react-native-sugar-style/tree/main/example) for a more detailed example.\nhttps://expo.io/@mohit23x/projects/react-native-sugar-style or try the [react native web version](https://sugar-style.netlify.app/)\n\n![Scan QR with expo app](assets/qr.png \"Scan QR\")\n\n## More\n\n[Guide](docs/Guide.md#Guide)\n\n[Constants](docs/Guide.md#Constants)\n\n[API](docs/Guide.md#API)\n\n[Live Example](docs/Guide.md#Demo)\n\n[Why this Package](docs/Guide.md#Why?)\n\n[Acknowledgement](docs/Guide.md#Acknowledgement)\n\n[Caveats](docs/Guide.md#Caveats)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohit23x%2Freact-native-sugar-style","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmohit23x%2Freact-native-sugar-style","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohit23x%2Freact-native-sugar-style/lists"}