{"id":23366723,"url":"https://github.com/d8corp/react-html-classes","last_synced_at":"2025-10-14T22:17:02.223Z","repository":{"id":42719713,"uuid":"256966579","full_name":"d8corp/react-html-classes","owner":"d8corp","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-09T02:20:33.000Z","size":456,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-09T14:30:11.649Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/d8corp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"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-19T10:01:34.000Z","updated_at":"2022-07-23T17:21:30.000Z","dependencies_parsed_at":"2023-02-08T08:15:59.244Z","dependency_job_id":null,"html_url":"https://github.com/d8corp/react-html-classes","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/d8corp/react-html-classes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d8corp%2Freact-html-classes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d8corp%2Freact-html-classes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d8corp%2Freact-html-classes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d8corp%2Freact-html-classes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/d8corp","download_url":"https://codeload.github.com/d8corp/react-html-classes/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d8corp%2Freact-html-classes/sbom","scorecard":{"id":315957,"data":{"date":"2025-08-11","repo":{"name":"github.com/d8corp/react-html-classes","commit":"6b09d8812fe0fa4912d0adf986c2b47940a1bcc9"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"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":"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":"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":"Code-Review","score":0,"reason":"Found 0/9 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":"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":"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":"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":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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 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":"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":"Vulnerabilities","score":0,"reason":"13 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","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-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"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-18T00:11:17.420Z","repository_id":42719713,"created_at":"2025-08-18T00:11:17.420Z","updated_at":"2025-08-18T00:11:17.420Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279021760,"owners_count":26087053,"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-14T02:00:06.444Z","response_time":60,"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-12-21T14:17:25.504Z","updated_at":"2025-10-14T22:17:02.189Z","avatar_url":"https://github.com/d8corp.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-html-classes\n[![NPM](https://img.shields.io/npm/v/react-html-classes.svg)](https://www.npmjs.com/package/react-html-classes)\n[![downloads](https://img.shields.io/npm/dm/react-html-classes.svg)](https://www.npmjs.com/package/react-html-classes)\n[![license](https://img.shields.io/npm/l/html-classes)](https://github.com/d8corp/react-html-classes/blob/master/LICENSE)  \nCombine html classes for React with pleasure.\n## Install\n```bash\nnpm i react-html-classes\n# or\nyarn add react-html-classes\n```\n## Usage\nIt was born to simplify the work with SCSS modules.\nUse [CRA](https://create-react-app.dev) to start a project.\n\nCreate a SCSS module file  \n`App.module.scss`\n```scss\n.root {\n  display: flex;\n  flex-direction: column;\n  height: 100vh;\n}\n\n.header {\n  height: 100px;\n  background: #aaa;\n}\n\n.footer {\n  background: #333;\n  color: #aaa;\n}\n\n.content {\n  flex: 1;\n}\n```\n\nImport the file into  \n`App.jsx`\n```typescript jsx\nimport { FC } from 'react'\nimport style, { MultipleStyleProps } from 'react-html-classes'\n\n// import our styles\nimport styles from './App.module.scss'\n\n// create style generator\nexport const getStyles = style(styles)\n\nexport interface AppProps extends MultipleStyleProps\u003cReturnType\u003ctypeof getStyles\u003e\u003e {\n  // add your props here\n}\n\nexport const App: FC\u003cAppProps\u003e = ({\n  className,\n  classNames,\n}) =\u003e {\n  // generate html classes list\n  const styles = getStyles(className, classNames)\n  \n  return (\n    \u003cdiv className={styles.root}\u003e\n      \u003cheader className={styles.header}\u003e\n        This is a header\n      \u003c/header\u003e\n      \u003cmain className={styles.content}\u003e\n        Hello World!\n      \u003c/main\u003e\n      \u003cfooter className={styles.footer}\u003e\n        FOOTER\n      \u003c/footer\u003e\n    \u003c/div\u003e\n  )\n}\n```\n\n## Features\nYou can provide any styles to the `App` component through props\n\n`index.ts`\n```typescript jsx\nimport { StrictMode } from 'react'\nimport { createRoot } from 'react-dom/client'\n\nimport { App } from './App'\n\nconst container = document.getElementById('root') as HTMLDivElement\nconst root = createRoot(container)\n\nroot.render(\n  \u003cStrictMode\u003e\n    \u003cApp\n      className='test'\n      classNames={{\n        root: 'test1',\n        header: 'test2',\n        content: 'test3',\n        footer: 'test4',\n      }}\n    /\u003e\n  \u003c/StrictMode\u003e\n)\n```\n\nYou can use any feature available with [html-classes](https://www.npmjs.com/package/html-classes)\non `className` and `classNames`\n```typescript jsx\nroot.render(\n  \u003cStrictMode\u003e\n    \u003cApp\n      className={() =\u003e 'test'}\n      classNames={{\n        root: { test1_1: true, test1_2: () =\u003e false },\n        header: ['test2_1', ['test2_2', 'test2_3']],\n        content: () =\u003e () =\u003e ['test3_1', () =\u003e 'test3_2'],\n        footer: new Set(['test4']),\n      }}\n    /\u003e\n  \u003c/StrictMode\u003e\n)\n```\n\n## Issues\nIf you find a bug, please file an issue on [GitHub](https://github.com/d8corp/react-html-classes/issues)  \n[![issues](https://img.shields.io/github/issues-raw/d8corp/react-html-classes)](https://github.com/d8corp/react-html-classes/issues)  \n \n[![stars](https://img.shields.io/github/stars/d8corp/react-html-classes?style=social)](https://github.com/d8corp/react-html-classes)\n[![watchers](https://img.shields.io/github/watchers/d8corp/react-html-classes?style=social)](https://github.com/d8corp/react-html-classes)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd8corp%2Freact-html-classes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fd8corp%2Freact-html-classes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd8corp%2Freact-html-classes/lists"}