![]()
A Chrome extension that switches Gmail to a dark “glass” look whenever macOS (or any OS) is in dark mode. If you use a Gmail theme with a background image, the image stays and is dimmed behind frosted dark panels.
Everything runs locally in your browser. Nothing is collected or sent anywhere: see the privacy policy.
Not affiliated with Google. Gmail is a trademark of Google LLC.
chrome://extensions and turn on Developer mode.The toolbar popup has quick controls (mode, glass, wallpaper brightness, email style). Wallpaper, accent color and more… opens the full settings page:
Hover any email for View original / View in dark and Always for this sender.
src/content.js: reads Gmail’s own stylesheets at runtime and writes a dark copy of every color rule and Material 3 token (--gm3-sys-color-*). Because it works from Gmail’s CSS rather than class names, it keeps working when Gmail renames its compiled classes. It also finds the main panel, wallpaper and message bodies by ARIA role, data-message-id and DOM shape, and tags them with data-gg-* attributes.src/glass.css: the glass layer. It only targets ARIA roles, [gh="cm"] (the compose button), #loading and the data-gg-* tags.src/defaults.js: settings defaults, accent colors and built-in wallpapers, shared by every part.src/background.js: measures image brightness and color (theme wallpaper, email logos).src/color.js: color parsing and the light-to-dark mapping rules.The one Gmail class name used is .a3s for the message body, and it has a structural fallback.
src/background.js measures the theme image for this. If the image can’t be read, the extension assumes a white wallpaper and uses the thickest setting.storage: your popup settings.mail.google.com, *.googleusercontent.com, *.gstatic.com and *.google.com/rd-mail-pt/*: only so the background worker can read images. It measures the theme image’s brightness (Gmail redirects it to lh3.google.com) and checks whether email logos are dark-on-transparent.