{"id":22393494,"url":"https://github.com/anmiles/theme-switcher","last_synced_at":"2026-02-04T07:31:36.526Z","repository":{"id":265767887,"uuid":"896430336","full_name":"anmiles/theme-switcher","owner":"anmiles","description":"Theme switcher for websites","archived":false,"fork":false,"pushed_at":"2025-09-19T06:18:03.000Z","size":1767,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-19T08:28:44.414Z","etag":null,"topics":["backend","css","express","frontend","javascript","jest","nodejs","react","switcher","theme","typescript","vite","websites"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/anmiles.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-11-30T10:46:24.000Z","updated_at":"2025-09-19T06:18:05.000Z","dependencies_parsed_at":"2025-09-19T08:06:36.580Z","dependency_job_id":"cff89c0a-661e-4073-b0ea-8cf694b84d82","html_url":"https://github.com/anmiles/theme-switcher","commit_stats":null,"previous_names":["anmiles/theme-switcher"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/anmiles/theme-switcher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anmiles%2Ftheme-switcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anmiles%2Ftheme-switcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anmiles%2Ftheme-switcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anmiles%2Ftheme-switcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anmiles","download_url":"https://codeload.github.com/anmiles/theme-switcher/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anmiles%2Ftheme-switcher/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279085462,"owners_count":26100017,"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-15T02:00:07.814Z","response_time":56,"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":["backend","css","express","frontend","javascript","jest","nodejs","react","switcher","theme","typescript","vite","websites"],"created_at":"2024-12-05T05:05:47.339Z","updated_at":"2025-10-15T14:31:45.994Z","avatar_url":"https://github.com/anmiles.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @anmiles/theme-switcher\n\nTheme switcher for websites\n\n----\n\n## Installation\n\n### For React+TS project\n\n1. Install package:\n\t```bash\n\tnpm install @anmiles/theme-switcher\n\t```\n\n2. Import component:\n\t```ts\n\timport { ThemeSwitcher } from '@anmiles/theme-switcher';\n\t```\n\n3. Use component:\n\t```ts\n\t\u003cThemeSwitcher float=\"right\" /\u003e\n\t```\n\twhere\n\t- `float` _(optional)_ - position of icon and dropdown box\n\n### For static HTML website\n\n1. Install package:\n\t```bash\n\tnpm install @anmiles/theme-switcher\n\t```\n\n2. Copy all files from `dist` into the target website.\n\n4. Create HTML container for theme switcher:\n\n\t```html\n\t\u003cdiv class=\"my-selector\"\u003e\u003c/div\u003e\n\t```\n\n5. Include React library and theme switcher:\n\n\t### Development\n\n\t```html\n\t\u003cscript type=\"text/javascript\" src=\"https://unpkg.com/react@18.3.1/umd/react.development.js\"\u003e\u003c/script\u003e\n\t\u003cscript type=\"text/javascript\" src=\"https://unpkg.com/react-dom@18.3.1/umd/react-dom.development.js\"\u003e\u003c/script\u003e\n\t\u003cscript type=\"text/javascript\" src=\"./theme-switcher-1.0.2.js\"\u003e\u003c/script\u003e\n\t```\n\n\t### Production\n\n\t```html\n\t\u003cscript type=\"text/javascript\" src=\"https://unpkg.com/react@18.3.1/umd/react.production.min.js\"\u003e\u003c/script\u003e\n\t\u003cscript type=\"text/javascript\" src=\"https://unpkg.com/react-dom@18.3.1/umd/react-dom.production.min.js\"\u003e\u003c/script\u003e\n\t\u003cscript type=\"text/javascript\" src=\"./theme-switcher-1.0.2.min.js\"\u003e\u003c/script\u003e\n\t```\n\n6. Place theme switcher into container:\n\n\t```html\n\t\u003cscript type=\"text/javascript\"\u003e\n\t\tnew ThemeSwitcher({ float: 'right' })\n\t\t\t.render(document.querySelector('.my-selector'));\n\t\u003c/script\u003e\n\t```\n\twhere\n\t- `float` _(optional)_ - position of icon and dropdown box\n\n## Usage\n\nUse selectors to write theme-specific styles:\n\n```css\n\tbody[data-theme=\"light\"] .selector {\n\t\t/* css rules */\n\t}\n```\n\n```css\n\tbody[data-theme=\"dark\"] .selector {\n\t\t/* css rules */\n\t}\n```\n\nOr you can just write default styles for light theme and override them for dark theme using `body[data-theme=\"dark\"]`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanmiles%2Ftheme-switcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanmiles%2Ftheme-switcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanmiles%2Ftheme-switcher/lists"}