{"id":37411816,"url":"https://github.com/avinashjoshi/color-scheme-toggle","last_synced_at":"2026-01-16T05:56:21.696Z","repository":{"id":57203326,"uuid":"278907459","full_name":"avinashjoshi/color-scheme-toggle","owner":"avinashjoshi","description":"A simple javascript to toggle your website between [ 🖥 system theme | 🌙 dark mode | ☀️ light mode ]","archived":false,"fork":false,"pushed_at":"2020-07-12T14:40:41.000Z","size":4,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-06T12:47:44.457Z","etag":null,"topics":["dark-mode","dark-mode-js","dark-mode-switch","dark-mode-switcher","dark-mode-toggle","darkmode","darkmode-js"],"latest_commit_sha":null,"homepage":"https://a10i.me/color-scheme-toggle/","language":"CSS","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/avinashjoshi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-11T17:14:23.000Z","updated_at":"2021-02-02T20:34:04.000Z","dependencies_parsed_at":"2022-09-18T01:11:13.205Z","dependency_job_id":null,"html_url":"https://github.com/avinashjoshi/color-scheme-toggle","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/avinashjoshi/color-scheme-toggle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avinashjoshi%2Fcolor-scheme-toggle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avinashjoshi%2Fcolor-scheme-toggle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avinashjoshi%2Fcolor-scheme-toggle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avinashjoshi%2Fcolor-scheme-toggle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/avinashjoshi","download_url":"https://codeload.github.com/avinashjoshi/color-scheme-toggle/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avinashjoshi%2Fcolor-scheme-toggle/sbom","scorecard":{"id":218274,"data":{"date":"2025-08-11","repo":{"name":"github.com/avinashjoshi/color-scheme-toggle","commit":"d97de4a50a7006e5aa0be4ac1ea5f96911d62a69"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"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":"Code-Review","score":0,"reason":"Found 0/2 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":"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":"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md: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"}}]},"last_synced_at":"2025-08-17T02:02:53.570Z","repository_id":57203326,"created_at":"2025-08-17T02:02:53.570Z","updated_at":"2025-08-17T02:02:53.570Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28477502,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T03:13:13.607Z","status":"ssl_error","status_checked_at":"2026-01-16T03:11:47.863Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["dark-mode","dark-mode-js","dark-mode-switch","dark-mode-switcher","dark-mode-toggle","darkmode","darkmode-js"],"created_at":"2026-01-16T05:56:20.828Z","updated_at":"2026-01-16T05:56:21.685Z","avatar_url":"https://github.com/avinashjoshi.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Color Scheme Toggle [ 🖥 | 🌙 | ☀️ ]\nA simple javascript to toggle your website between [ 🖥 system theme | 🌙 dark mode | ☀️ light mode ]\n- Defaults to system theme\n- Your preference is saved to local storage\n\n# Usage\n1. Add your custom button for the toggle followed by the `color-scheme-toggle.js` script:\n```html\n\u003cbutton id=\"color-scheme-toggle\"\u003e\u003c/button\u003e\n\u003cscript src=\"color-scheme-toggle.js\"\u003e\u003c/script\u003e\n```\n*The script could even go before the closing body tag, but not before the button*\n\n2. Follow `color-scheme-toggle.css` as an example (or the sample css provided below) and adapt in your stylesheet.\n\n# Under the hood\nThe script adds `data-theme=\"dark\"` to the `html` tag. You can use css like this:\n```css\n:root {\n    --body-bg: white;\n    --body-color: black;\n}\n\n:root[data-theme='dark'] {\n    --body-bg: black;\n    --body-color: white;\n}\n\nbody {\n    background-color: var(--body-bg);\n    color: var(--body-color);\n}\n```\n\n# Demo\nVisit the [Demo page](https://avinashjoshi.github.io/color-scheme-toggle) to see this in action!\n\n# Browser compatibility\n- Toggling between light and dark should be supported by most modern browsers that support javascript\n- The system theme compatibility can be seen here - https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme#Browser_compatibility\n\n# Sticky footer\nI simply followed the [recipe laid out by Mozilla](https://developer.mozilla.org/en-US/docs/Web/CSS/Layout_cookbook/Sticky_footers). This does not seem to work on Firefox.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favinashjoshi%2Fcolor-scheme-toggle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favinashjoshi%2Fcolor-scheme-toggle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favinashjoshi%2Fcolor-scheme-toggle/lists"}