{"id":21240643,"url":"https://github.com/chrisnajman/accessible-dark-mode-toggle-button","last_synced_at":"2026-02-08T23:36:41.164Z","repository":{"id":171912490,"uuid":"648575053","full_name":"chrisnajman/accessible-dark-mode-toggle-button","owner":"chrisnajman","description":"An accessible dark mode toggle button using the ARIA-pressed attribute","archived":false,"fork":false,"pushed_at":"2024-01-13T12:48:09.000Z","size":48,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-07T04:49:00.149Z","etag":null,"topics":["accessibility","html-css-javascript","toggle-buttons"],"latest_commit_sha":null,"homepage":"https://chrisnajman.github.io/accessible-dark-mode-toggle-button/","language":"HTML","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/chrisnajman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-06-02T09:38:12.000Z","updated_at":"2024-09-30T10:18:52.000Z","dependencies_parsed_at":"2024-01-13T14:28:32.098Z","dependency_job_id":"89d23b13-87ae-432d-9266-9bf9b1cab72a","html_url":"https://github.com/chrisnajman/accessible-dark-mode-toggle-button","commit_stats":null,"previous_names":["chrisnajman/accessible-dark-mode-toggle-button"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chrisnajman/accessible-dark-mode-toggle-button","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisnajman%2Faccessible-dark-mode-toggle-button","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisnajman%2Faccessible-dark-mode-toggle-button/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisnajman%2Faccessible-dark-mode-toggle-button/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisnajman%2Faccessible-dark-mode-toggle-button/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chrisnajman","download_url":"https://codeload.github.com/chrisnajman/accessible-dark-mode-toggle-button/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisnajman%2Faccessible-dark-mode-toggle-button/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29249554,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-08T22:49:53.206Z","status":"ssl_error","status_checked_at":"2026-02-08T22:49:51.384Z","response_time":57,"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":["accessibility","html-css-javascript","toggle-buttons"],"created_at":"2024-11-21T00:52:17.549Z","updated_at":"2026-02-08T23:36:41.137Z","avatar_url":"https://github.com/chrisnajman.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Accessible Dark Mode Toggle Button\n\n- [Website (Git Pages)](https://chrisnajman.github.io/accessible-dark-mode-toggle-button)\n- [View on Codepen](https://codepen.io/Naj-codepen/pen/JjmgWXM)\n\n## Description\n\nAn accessible dark mode toggle button employing `ARIA` attributes for screen reader users.\n\nAdditionally, visual cues (icon, on/off text) are provided for sighted users.\n\n## Accessibility\n\n- The `ARIA-pressed` attribute indicates the button state to screen readers.\n- The `ARIA-hidden` attribute hides the SVG icon and CSS `content` text from screenreaders.\n- Keyboard navigation via the `Tab` key focuses the button.\n\n## CSS\n\n- CSS variables are used for the dark and light themes.\n- The `content` property prints 'on' or 'off' according to the state of the button.\n\n## Javascript\n\n- Button state is saved to local storage, so the chosen theme persists.\n- ES6 (no transpilation to ES5)\n\n## Sources\n\n- [`ARIA-pressed` information (and more) from Inclusive Components/Toggle Buttons](https://inclusive-components.design/toggle-button/)\n- ['Moon' icon from Free Box Icons (click SVG tab for code))](https://boxicons.com/?query=Moon)\n\n## Testing\n\n- Tested on:\n  - Windows 10\n    - Chrome\n    - Firefox\n    - Microsoft Edge\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisnajman%2Faccessible-dark-mode-toggle-button","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrisnajman%2Faccessible-dark-mode-toggle-button","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisnajman%2Faccessible-dark-mode-toggle-button/lists"}