{"id":13793412,"url":"https://github.com/tkh44/restyles","last_synced_at":"2025-09-09T22:38:48.467Z","repository":{"id":57355140,"uuid":"90704817","full_name":"tkh44/restyles","owner":"tkh44","description":"👩‍🚀 declarative glamor for react and preact","archived":false,"fork":false,"pushed_at":"2017-10-19T22:49:45.000Z","size":32,"stargazers_count":46,"open_issues_count":2,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-05T12:56:23.359Z","etag":null,"topics":["css","css-in-js","glamor","preact","react"],"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/tkh44.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":"2017-05-09T05:11:46.000Z","updated_at":"2021-05-07T15:43:37.000Z","dependencies_parsed_at":"2022-08-28T13:21:28.584Z","dependency_job_id":null,"html_url":"https://github.com/tkh44/restyles","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/tkh44/restyles","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkh44%2Frestyles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkh44%2Frestyles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkh44%2Frestyles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkh44%2Frestyles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tkh44","download_url":"https://codeload.github.com/tkh44/restyles/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tkh44%2Frestyles/sbom","scorecard":{"id":888921,"data":{"date":"2025-08-11","repo":{"name":"github.com/tkh44/restyles","commit":"a62bdb9f39d029b1037f9bdf9c1937a74600f092"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"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 1/29 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":"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":"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":"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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"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":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"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 1 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"}}]},"last_synced_at":"2025-08-24T11:01:38.222Z","repository_id":57355140,"created_at":"2025-08-24T11:01:38.223Z","updated_at":"2025-08-24T11:01:38.223Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274374487,"owners_count":25273823,"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-09-09T02:00:10.223Z","response_time":80,"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":["css","css-in-js","glamor","preact","react"],"created_at":"2024-08-03T23:00:20.833Z","updated_at":"2025-09-09T22:38:48.422Z","avatar_url":"https://github.com/tkh44.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Uncategorized"],"sub_categories":["Uncategorized"],"readme":"# restyles\n\n**Declarative [glamor](https://github.com/threepointone/glamor)** \n\n\nWrite styles scoped to your component and use standard css selectors to target children.\nDue to its tiny size, restyles makes the perfect companion for [glamorous](https://github.com/paypal/glamorous).\n\n\n[![npm version](https://badge.fury.io/js/restyles.svg)](https://badge.fury.io/js/restyles)\n[![Build Status](https://travis-ci.org/tkh44/restyles.svg?branch=master)](https://travis-ci.org/tkh44/restyles)\n[![codecov](https://codecov.io/gh/tkh44/restyles/branch/master/graph/badge.svg)](https://codecov.io/gh/tkh44/restyles)\n\n-   [Install](#install)\n-   [Basic Usage](#basic-usage)\n-   [Props](#props)\n\n## Install\n\n```bash\nnpm install -S restyles\n```\n\n## Basic Usage\n```jsx\nconst Profile = props =\u003e (\n  \u003cStyle\n    css={{\n      color: 'blue',\n      ':hover': {\n        color: 'red'\n      },\n      '\u0026 .profile': {\n        color: props.online ? 'green' : 'gray',\n        fontSize: 20,\n        '@media (min-width: 768px)': {\n          color: 'aquamarine'\n        }\n      }\n    }}\n    render={cls =\u003e (\n      \u003cdiv className={cls}\u003e\n        This will be blue until hovered.\n        \u003cdiv className=\"profile\"\u003e\n          This font size will be 20px\n        \u003c/div\u003e\n      \u003c/div\u003e\n    )}\n  /\u003e\n)\n```\n\n## Props\n\n#### children `fn`\n\nFunction to render your children. Its only argument is a class name that you can apply to an element of your choice. \nUsually this is the outermost element(s) of your children.\n\n**`render` takes precedence over `children`**\n\n*use `render` for better performance* \n\n\n\n#### css `object|array\u003cobject\u003e`\n\nYour css as an object. This is passed straight through to cxs.\n\n*[glamor docs](https://github.com/threepointone/glamor/blob/master/README.md)*\n\n```jsx\nconst Profile = props =\u003e (\n  \u003cStyle\n    css={{\n      color: 'blue',\n      '\u0026 .profile': {\n        color: 'red',\n        '\u0026 .username': {\n          color: 'green',\n          '\u0026 .three': {\n            color: 'gray',\n            '\u0026 .inner': {\n              color: 'rebeccapurple',\n              fontSize: 20\n            }\n          }\n        }\n      },\n      ':hover': {\n        '\u0026 .three': {\n          color: 'black'\n        }\n      },\n      ':active': {\n        '\u0026 .inner': {\n          color: 'purple',\n          fontSize: 20\n        }\n      },\n      ':before': {\n        content: '\" \"',\n        position: 'absolute',\n        top: 0,\n        left: 0,\n        width: '100%',\n        height: '100%',\n        backgroundColor: 'blue'\n      },\n      '@media (min-width: 500px) and (orientation: landscape)': {\n        '\u0026 .inner': {\n          color: 'purple',\n          fontSize: 48\n        }\n      }\n    }}\n    render={cls =\u003e (\n      \u003cdiv className={cls}\u003e\n        blue\n        \u003cdiv className={'profile'}\u003e\n          red\n          \u003cdiv className={'username'}\u003e\n            green\n            \u003cdiv className={'three'}\u003e\n              \u003cspan className={'inner'}\u003etest\u003c/span\u003e\n            \u003c/div\u003e\n          \u003c/div\u003e\n        \u003c/div\u003e\n      \u003c/div\u003e\n    )}\n  /\u003e\n)\n```\n\n\n\n#### render `fn`\n\n**takes precedence over `children`**\n\n\nFunction to render your children. Its only argument is a class name that you can apply to an element of your choice. \nUsually this is the outermost element(s) of your children.\n\n\n```jsx\nconst Greeting = ({ name }) =\u003e (\n  \u003cStyle\n    css={{\n      color: '#63e6be',\n      fontSize: 48,\n      letterSpacing: '1ch',\n      ':hover': {\n        color: '#0ca678'\n      }\n    }}\n    render={cls =\u003e \u003ch1 className={cls}\u003eHello {name}\u003c/h1\u003e}\n  /\u003e\n)\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftkh44%2Frestyles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftkh44%2Frestyles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftkh44%2Frestyles/lists"}