{"id":13725134,"url":"https://github.com/tomayac/dark-mode-email","last_synced_at":"2026-03-03T06:31:29.121Z","repository":{"id":51406934,"uuid":"198792675","full_name":"tomayac/dark-mode-email","owner":"tomayac","description":"This repo shows how to create emails that support dark mode.","archived":false,"fork":false,"pushed_at":"2021-05-12T01:06:12.000Z","size":56,"stargazers_count":161,"open_issues_count":4,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T00:17:05.164Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomayac.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}},"created_at":"2019-07-25T08:42:10.000Z","updated_at":"2024-06-17T07:17:18.000Z","dependencies_parsed_at":"2022-09-11T17:01:11.201Z","dependency_job_id":null,"html_url":"https://github.com/tomayac/dark-mode-email","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomayac%2Fdark-mode-email","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomayac%2Fdark-mode-email/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomayac%2Fdark-mode-email/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomayac%2Fdark-mode-email/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomayac","download_url":"https://codeload.github.com/tomayac/dark-mode-email/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248799951,"owners_count":21163404,"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":[],"created_at":"2024-08-03T01:02:13.917Z","updated_at":"2026-03-03T06:31:29.083Z","avatar_url":"https://github.com/tomayac.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# 🌒 Dark Mode Email\n\nIt is possible to send email 📧 that is sensitive to the user's `prefers-color-scheme` (☀️/🌒) setting.\n\n## Dark Mode Email Template\n\nThe below is a future-proof email template for dark mode:\n\n```html\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003cmeta name=\"color-scheme\" content=\"light dark\"\u003e\n    \u003cmeta name=\"supported-color-schemes\" content=\"light dark\"\u003e\n    \u003cstyle\u003e\n      :root {\n        color-scheme: light dark;\n        supported-color-schemes: light dark;\n      }\n      body {\n        background-color: #eee;\n        color: #111;\n      }\n      @media (prefers-color-scheme: dark) {\n        body {\n          background-color: #111;\n          color: #eee;\n        }\n      }\n    \u003c/style\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    🖖 Hello Dark Mode!\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n## Dark Mode Email Example\n\nThe screenshots below show a slightly more involved\n[example](https://github.com/tomayac/dark-mode-email/blob/05230b181bb902e9ae968cfb43024a1e27a0224a/index.js#L22-L80)\nthat includes a dynamically switching image, because, why not…\nOn email clients that currently don't support `prefers-color-scheme`,\nit silently falls back to light mode.\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003cfigure\u003e\n        \u003cimg style=\"border:solid 1px black;\" width=\"200\" alt=\"\" src=\"https://user-images.githubusercontent.com/145676/61888762-658d4d80-af04-11e9-84ae-3255213fb9da.PNG\"\u003e\n        \u003cfigcaption\u003e\u003cbr\u003eiOS Mail (dark mode)\u003c/figcaption\u003e\n      \u003c/figure\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003cfigure\u003e\n        \u003cimg width=\"200\" alt=\"\" src=\"https://user-images.githubusercontent.com/145676/61888763-658d4d80-af04-11e9-8aa0-fab1104ae687.PNG\"\u003e\n        \u003cfigcaption\u003e\u003cbr\u003eiOS Mail (light mode)\u003c/figcaption\u003e\n      \u003c/figure\u003e      \n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003cfigure\u003e\n        \u003cimg width=\"200\" alt=\"\" src=\"https://user-images.githubusercontent.com/145676/61888764-658d4d80-af04-11e9-815e-300616660253.PNG\"\u003e\n        \u003cfigcaption\u003e\u003cbr\u003eiOS Gmail (fallback light mode)\u003c/figcaption\u003e\n      \u003c/figure\u003e    \n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd colspan=\"3\"\u003e\n      \u003cfigure\u003e\n        \u003cimg width=\"700\" alt=\"\" src=\"https://user-images.githubusercontent.com/145676/61888754-5efed600-af04-11e9-828d-8b2251343485.png\"\u003e\n        \u003cfigcaption\u003e\u003cbr\u003eDesktop Gmail (fallback light mode)\u003c/figcaption\u003e\n      \u003c/figure\u003e                \n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## Who Made This\n\nMade with HTML and CSS by 🐦 [@tomayac](https://twitter.com/tomayac).\n\n## Acknowledgements\n\nThanks to 🐦 [@xeenon](https://twitter.com/xeenon/status/1153810328808853506) for the\n[WWDC session video](https://developer.apple.com/videos/play/wwdc2019/511/) pointer.\n\n## License\n\nApache 2.0.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomayac%2Fdark-mode-email","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomayac%2Fdark-mode-email","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomayac%2Fdark-mode-email/lists"}