{"id":29656555,"url":"https://github.com/mateosilguero/consistencss","last_synced_at":"2025-07-22T08:36:00.509Z","repository":{"id":38425118,"uuid":"258395428","full_name":"mateosilguero/consistencss","owner":"mateosilguero","description":"An \"atomic css\" style toolkit for React Native","archived":false,"fork":false,"pushed_at":"2023-03-04T14:14:47.000Z","size":5655,"stargazers_count":48,"open_issues_count":32,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-24T15:54:42.388Z","etag":null,"topics":["atomic-css","css","react-native","styles","typescript"],"latest_commit_sha":null,"homepage":"https://consistencss.now.sh/","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/mateosilguero.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-24T03:30:33.000Z","updated_at":"2025-04-02T09:26:57.000Z","dependencies_parsed_at":"2023-02-18T04:01:23.472Z","dependency_job_id":null,"html_url":"https://github.com/mateosilguero/consistencss","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/mateosilguero/consistencss","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mateosilguero%2Fconsistencss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mateosilguero%2Fconsistencss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mateosilguero%2Fconsistencss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mateosilguero%2Fconsistencss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mateosilguero","download_url":"https://codeload.github.com/mateosilguero/consistencss/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mateosilguero%2Fconsistencss/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266456411,"owners_count":23931405,"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-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["atomic-css","css","react-native","styles","typescript"],"created_at":"2025-07-22T08:35:56.035Z","updated_at":"2025-07-22T08:36:00.481Z","avatar_url":"https://github.com/mateosilguero.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# consistencss\n\n\u003c!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --\u003e\n\n[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors-)\n\n\u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e\n[![npm version](https://badge.fury.io/js/consistencss.svg)](https://badge.fury.io/js/consistencss)\n![consistencss](https://badgen.net/bundlephobia/minzip/consistencss)\n![consistencss](https://badgen.net/npm/types/consistencss)\n\n![logo](https://consistencss.now.sh/img/logo.svg 'Logo')\n\nAn \"atomic css\" style toolkit for React Native, inspired by [tailwindcss](https://tailwindcss.com/docs/installation/)\n\nFull Documentation: https://consistencss.now.sh/\n\n## Installation\n\n```sh\nnpm install consistencss\n```\n\nusing yarn:\n\n```sh\nyarn add consistencss\n```\n\n## Troubleshooting\n\nSee [Troubleshooting](./Troubleshooting.md).\n\n## Usage\n\n```js\nimport { View } from 'react-native';\nimport C, { apply } from 'consistencss';\n\n// ...\nconst App = () =\u003e {\n  return (\n    \u003cView style={apply(C.m4, C.p2, C.bgRed)}\u003e\n      \u003cText style={C.textRed}\u003e\u003c/Text\u003e\n      \u003cText style={[C.textBlue, C.m6]}\u003e\u003c/Text\u003e\n      \u003cText style={styles.subtitle}\u003e\u003c/Text\u003e\n    \u003c/View\u003e\n  );\n};\n\n// apply also accepts strings\nconst styles = {\n  title: apply(C.font6, C.uppercase),\n  subtitle: apply('capitalize', C.mt2),\n};\n```\n\n## Set your theme using `extend`\n\n```js\nimport { View } from 'react-native';\nimport C, { apply, extend } from 'consistencss';\n\nextend({\n  colors: {\n    primary: 'cornflowerblue',\n    secondary: 'green',\n    randomcolor: '#f2d687',\n  },\n});\n\nconst App = () =\u003e {\n  return (\n    \u003cView style={apply(C.bgPrimary)}\u003e\n      \u003cView style={apply(C.bgRandomcolor)}\u003e\u003c/View\u003e\n    \u003c/View\u003e\n  );\n};\n```\n\nor change the default base size (4):\n\n```js\nimport { Text, View } from 'react-native';\nimport C, { apply, extend } from 'consistencss';\n\n// the default base is 4, so m4 = margin: 16\n// m2 = margin: 8\n\nextend({\n  sizing: {\n    base: 2,\n  },\n});\n\n// chaging to 2, m4 = margin: 8\n// m2 = margin: 4\n\nconst App = () =\u003e {\n  return \u003cView style={apply(C.mt4)}\u003e\u003c/View\u003e;\n};\n```\n\neven you could set default styles for componentes, like View, Text and TouchableOpacity\n\n```js\nimport C, { apply, extend, View } from 'consistencss';\n\nextend({\n  components: {\n    View: apply(C.bgYellow, C.p4),\n  },\n});\n\nconst App = () =\u003e {\n  // we import View from consistencss\n  // and this have a default style\n  return \u003cView\u003e\u003c/View\u003e;\n};\n```\n\nUses the classNames API, and create your custom classes !\n\n```js\nimport C, { apply, extend, classNames, View, Text } from 'consistencss';\n\nextend({\n  classes: {\n    debug: apply(C.border1, C.borderRed),\n  },\n});\n\nconst App = () =\u003e {\n  return (\n    \u003cView style={C.debug}\u003e\n      \u003cText style={classNames('debug')}\u003e\n        ...\n      \u003c/Text\u003e\n    \u003c/View\u003e;\n};\n```\n\n## This repository includes:\n\n- [source code](./src/index.tsx) (with their respective unit test and 100% of code coverage, and benchmark test)\n- [an example app](./example/index.tsx)\n- [documentation](./website/README.md) (powered by [docusaurus](https://docusaurus.io))\n\n## License\n\nMIT\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n   \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/mateosilguero\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/25598400?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eMateo Silguero\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/mateosilguero/consistencss/commits?author=mateosilguero\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://leites.dev\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/1316339?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eEzequiel Leites\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/mateosilguero/consistencss/commits?author=leiteszeke\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e \n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-enable --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmateosilguero%2Fconsistencss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmateosilguero%2Fconsistencss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmateosilguero%2Fconsistencss/lists"}