{"id":18245005,"url":"https://github.com/edgeapp/react-native-patina","last_synced_at":"2025-10-08T00:03:58.096Z","repository":{"id":42779818,"uuid":"275231891","full_name":"EdgeApp/react-native-patina","owner":"EdgeApp","description":"A simple, type-aware theming library","archived":false,"fork":false,"pushed_at":"2023-10-10T22:28:53.000Z","size":344,"stargazers_count":2,"open_issues_count":4,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-08T00:03:09.445Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/EdgeApp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-26T19:26:07.000Z","updated_at":"2025-10-05T03:13:51.000Z","dependencies_parsed_at":"2023-10-11T00:48:52.798Z","dependency_job_id":"65af63ff-b7b8-4881-a010-93ac14a17c74","html_url":"https://github.com/EdgeApp/react-native-patina","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/EdgeApp/react-native-patina","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EdgeApp%2Freact-native-patina","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EdgeApp%2Freact-native-patina/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EdgeApp%2Freact-native-patina/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EdgeApp%2Freact-native-patina/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EdgeApp","download_url":"https://codeload.github.com/EdgeApp/react-native-patina/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EdgeApp%2Freact-native-patina/sbom","scorecard":{"id":44261,"data":{"date":"2025-08-11","repo":{"name":"github.com/EdgeApp/react-native-patina","commit":"908b6a18492f9cfcb3e37129731025b0def17d1f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.2,"checks":[{"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":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":"Code-Review","score":0,"reason":"Found 2/25 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":"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":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/pr-checks.yml:1","Warn: no topLevel permission defined: .github/workflows/pr-rebase.yml:1","Info: no jobLevel write permissions found"],"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pr-checks.yml:7: update your workflow using https://app.stepsecurity.io/secureworkflow/EdgeApp/react-native-patina/pr-checks.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pr-checks.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/EdgeApp/react-native-patina/pr-checks.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pr-rebase.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/EdgeApp/react-native-patina/pr-rebase.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pr-rebase.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/EdgeApp/react-native-patina/pr-rebase.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned"],"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":"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":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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 7 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":0,"reason":"11 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","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-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7"],"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-14T22:20:32.690Z","repository_id":42779818,"created_at":"2025-08-14T22:20:32.690Z","updated_at":"2025-08-14T22:20:32.690Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278866931,"owners_count":26059671,"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-10-07T02:00:06.786Z","response_time":59,"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-11-05T09:18:35.468Z","updated_at":"2025-10-08T00:03:58.080Z","avatar_url":"https://github.com/EdgeApp.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-patina\n\nThis tiny theming library has two main parts:\n\n- [A `ThemeContext` object](#using-themecontext) distributes the current theme througout your app.\n- [A `cacheStyles` helper](#using-cachestyles) caches calls to `StyleSheet.create`.\n\nYou can use these parts either together or separately. Both come with deep, automatic support for both Flow \u0026 Typescript.\n\nThis library is unopinionated about what a theme should contain. A \"theme\" is just a plain Javascript object with whatever properties you like (including methods). Here is an example of a pair of themes:\n\n```tsx\nconst darkTheme = {\n  backgroundColor: '#000000',\n  foregroundColor: '#ffffff',\n  rem: (size: number) =\u003e Math.round(size * 16)\n}\n\nconst lightTheme = {\n  ...darkTheme,\n  backgroundColor: '#ffffff',\n  foregroundColor: '#000000'\n}\n\ntype AppTheme = typeof darkTheme\n```\n\n## Using ThemeContext\n\nThe `ThemeContext` object can help distribute a theme object throughout your app. Compared to just using the React context API directly, `ThemeContext` adds a way for non-React code to also get access to the current theme. This can be important if you have Redux actions or other logic that might also care about appearances.\n\nFirst, create a `ThemeContext` object based on your initial theme:\n\n```tsx\nimport { makeThemeContext } from 'react-native-patina'\n\n// The ThemeContext contains a bunch of methods your app\n// can call directly:\nexport const {\n  ThemeProvider,\n  useTheme,\n  withTheme,\n  changeTheme,\n  getTheme,\n  watchTheme\n} = makeThemeContext(darkTheme)\n```\n\nNext, use the `ThemeContext.ThemeProvider` component to inject the current theme into your React component tree:\n\n```tsx\nconst YourApp = () =\u003e (\n  \u003cThemeProvider\u003e\n    \u003cAllYourScenes /\u003e\n  \u003c/ThemeProvider\u003e\n)\n```\n\nThe `ThemeContext.useTheme` hook lets your function-style components access the current theme:\n\n```tsx\nconst HeaderText = props =\u003e {\n  const theme = useTheme()\n\n  // Note: See cacheStyles for how to optimize this:\n  const style = {\n    color: theme.foregroundColor,\n    fontSize: theme.rem(1.2)\n  }\n  return \u003cText style={style}\u003e{props.message}\u003c/Text\u003e\n}\n```\n\nOr, if you are using class-based components, use the `ThemeContext.withTheme` wrapper to inject a `theme` property into your component:\n\n```tsx\nclass HeaderTextInner {\n  render() {\n    const { theme } = this.props\n\n    // Note: See cacheStyles for how to optimize this:\n    const style = {\n      color: theme.foregroundColor,\n      fontSize: theme.rem(1.2)\n    }\n    return \u003cText style={style}\u003e{this.props.message}\u003c/Text\u003e\n  }\n}\n\nexport const HeaderText = withTheme(HeaderTextInner)\n```\n\nTo change the current theme, just call `ThemeContext.changeTheme`:\n\n```tsx\nchangeTheme(lightTheme)\n```\n\nThis will automatically re-render any React components that use the theme.\n\nIf non-React code needs to access the theme, use `ThemeContext.getTheme` to read the current theme:\n\n```tsx\nStatusBar.setBackgroundColor(getTheme().statusBarColor)\n```\n\nYou can also use `ThemeProvider.watchTheme` to subscribe to updates:\n\n```tsx\nconst unsubscribe = watchTheme(theme =\u003e {\n  StatusBar.setBackgroundColor(theme.statusBarColor)\n})\n\n// Call unsubscribe() later if you want to clean up.\n```\n\n## Using cacheStyles\n\nThe examples above use inline React Native styles, which are slow. Your app will perform much better if it uses `StyleSheet.create` to build its style sheets ahead of time. On the other hand, just calling `StyleSheet.create` at startup won't work, because then the styles won't change when the theme changes.\n\nThe `cacheStyles` helper function solves this by memoizing (caching) calls to `StyleSheet.create`:\n\n```tsx\nimport { cacheStyles } from 'react-native-patina'\n\nexport const getStyles = cacheStyles((theme: AppTheme) =\u003e ({\n  header: {\n    color: theme.foregroundColor,\n    fontSize: theme.rem(1.2)\n  },\n\n  text: {\n    color: theme.foregroundColor,\n    fontSize: theme.rem(1)\n  }\n}))\n```\n\nThis example uses `cacheStyles` to wrap a `getStyles` function with caching. This `getStyles` function accepts the current theme and returns a matching set of styles. From then on, as long as the theme doesn't change, `getStyles` will continue to return the same cached value:\n\n```tsx\nconst HeaderText = props =\u003e {\n  const theme = ThemeContext.useTheme()\n  const styles = getStyles(theme)\n\n  return \u003cText style={styles.header}\u003e{props.message}\u003c/Text\u003e\n}\n```\n\nBy default, `cacheStyles` will only remember the last-used theme. If your app frequently switches between several themes, you can increase the cache size to keep more than one style sheet around at once:\n\n```tsx\nimport { setCacheSize } from 'react-native-patina'\n\nsetCacheSize(4) // Remember style sheets for the last 4 themes\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedgeapp%2Freact-native-patina","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedgeapp%2Freact-native-patina","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedgeapp%2Freact-native-patina/lists"}