{"id":18565959,"url":"https://github.com/alexwhitmore/simple-themes","last_synced_at":"2026-05-05T11:34:33.457Z","repository":{"id":200601069,"uuid":"705898122","full_name":"alexwhitmore/simple-themes","owner":"alexwhitmore","description":"Drop in dark mode in with theme preference and no flashes of unstyled content.","archived":false,"fork":false,"pushed_at":"2023-12-05T05:46:26.000Z","size":89,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-15T19:44:31.422Z","etag":null,"topics":["astro","css","dark-mode","dark-theme","html","javascript","themes"],"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/alexwhitmore.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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,"publiccode":null,"codemeta":null}},"created_at":"2023-10-16T23:06:47.000Z","updated_at":"2023-10-17T17:00:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"0cd38069-d068-434e-a647-37e8ffcc6fe1","html_url":"https://github.com/alexwhitmore/simple-themes","commit_stats":null,"previous_names":["alexwhitmore/simple-themes"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alexwhitmore/simple-themes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexwhitmore%2Fsimple-themes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexwhitmore%2Fsimple-themes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexwhitmore%2Fsimple-themes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexwhitmore%2Fsimple-themes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexwhitmore","download_url":"https://codeload.github.com/alexwhitmore/simple-themes/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexwhitmore%2Fsimple-themes/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267293752,"owners_count":24065320,"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-07-27T02:00:11.917Z","response_time":82,"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":["astro","css","dark-mode","dark-theme","html","javascript","themes"],"created_at":"2024-11-06T22:21:11.213Z","updated_at":"2026-05-05T11:34:28.421Z","avatar_url":"https://github.com/alexwhitmore.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple Themes\n\nDrop in dark mode with 2 lines of code with `prefers-color-scheme` and no flash of unstyled content (FOUC)!\n\n\u003e [!WARNING]\n\u003e This project is a WIP, and should not be used in a production environment yet.\n\n## HTML Set up\n\nCDN link to be used in your project\n\n```html\n\u003cscript src=\"\nhttps://cdn.jsdelivr.net/npm/simple-themes@0.0.1/src/theme-toggle.min.js\n\"\u003e\u003c/script\u003e\n```\n\nindex.html\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n  \u003chead\u003e\n    \u003cmeta charset=\"UTF-8\" /\u003e\n    \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" /\u003e\n    \u003clink rel=\"stylesheet\" href=\"styles.css\" /\u003e\n    \u003cscript src=\"\nhttps://cdn.jsdelivr.net/npm/simple-themes@0.0.1/src/theme-toggle.min.js\n\"\u003e\u003c/script\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003cbutton id=\"theme-btn\"\u003eToggle Theme\u003c/button\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\nstyles.css\n```css\n:root,\nhtml[data-theme='light'] {\n  background-color: white;\n  color: black;\n}\n\nhtml[data-theme='dark'] {\n  background-color: black;\n  color: white;\n}\n```\n\n## [Astro](https://github.com/withastro/astro) Set Up\n\nsrc/pages/index.astro\n```astro\n---\nimport '../styles/globals.css'\n---\n\n\u003chtml lang=\"en\"\u003e\n  \u003chead\u003e\n    \u003cscript is:inline src=\"\nhttps://cdn.jsdelivr.net/npm/simple-themes@0.0.1/src/theme-toggle.min.js\n\"\u003e\u003c/script\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003cbutton id=\"theme-btn\"\u003eToggle Theme\u003c/button\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\nsrc/styles/globals.css\n```css\n:root,\nhtml[data-theme='light'] {\n  background-color: white;\n  color: black;\n}\n\nhtml[data-theme='dark'] {\n  background-color: black;\n  color: white;\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexwhitmore%2Fsimple-themes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexwhitmore%2Fsimple-themes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexwhitmore%2Fsimple-themes/lists"}