{"id":17930612,"url":"https://github.com/remy/light-dark-switcher","last_synced_at":"2025-09-11T23:41:26.672Z","repository":{"id":66078050,"uuid":"378875510","full_name":"remy/light-dark-switcher","owner":"remy","description":"Light/Dark theme switcher for Firefox","archived":false,"fork":false,"pushed_at":"2021-12-21T20:17:32.000Z","size":421,"stargazers_count":18,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-19T02:01:35.221Z","etag":null,"topics":["addon","dark","firefox","firefox-addon","firefox-extension","light","theme"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/remy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"remy"}},"created_at":"2021-06-21T09:24:01.000Z","updated_at":"2024-12-19T23:47:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"9f314855-53d7-44b2-b336-3bb1c159fa3d","html_url":"https://github.com/remy/light-dark-switcher","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remy%2Flight-dark-switcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remy%2Flight-dark-switcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remy%2Flight-dark-switcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remy%2Flight-dark-switcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remy","download_url":"https://codeload.github.com/remy/light-dark-switcher/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245211106,"owners_count":20578351,"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","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":["addon","dark","firefox","firefox-addon","firefox-extension","light","theme"],"created_at":"2024-10-28T21:14:53.151Z","updated_at":"2025-03-24T04:31:23.445Z","avatar_url":"https://github.com/remy.png","language":"JavaScript","funding_links":["https://github.com/sponsors/remy"],"categories":[],"sub_categories":[],"readme":"# Light/Dark switcher\n\nThis Firefox addon bakes in functionality I suspect will eventually make its way into the browser, but in the mean time it's an extension that quietly waits for your system theme to toggle and reflects the change in your theme at the same time.\n\n## Overview\n\nThis project uses two methods to allow the user to select their theme. The first is using the `management` permission which allows us to iterate through each theme installed in the browser.\n\nThe second method uses the excellent [color.firefox.com](https://color.firefox.com) and source code from that project to convert a `https://color.firefox.com?theme=...` URL to a theme.\n\nOnce selected, this content is stored in the `storage` addon feature.\n\nUnder the hood, a background script watches a media query and fires an event when it changes:\n\n```\nwindow.matchMedia('(prefers-color-scheme: dark)').addListener((e) =\u003e {\n  toggleTo(e.matches ? DARK : LIGHT);\n});\n```\n\n## Specific notes about code/linting\n\n- Function eval is being used in a 3rd party module, specifically: `json-url` - this is used by the color.firefox project to convert encoded themes into JSON (saving a handful of bytes)\n- `innerHTML` is used to generate the list of theme options - this is consistently faster both in render time and writing time to use over DOM scripting, and is controlled by the addon and not user generated.\n\n## To test and develop\n\n- `npm ci` to install all dependencies\n- `npm run dev` will generate the root `background.html` file required for testing\n- `npm run build` to generate a new build\n\n## License\n\n- [MIT License](https://rem.mit-license.org/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremy%2Flight-dark-switcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremy%2Flight-dark-switcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremy%2Flight-dark-switcher/lists"}