---
title: A lightweight theme toggle extension that's better than Dark Reader
description: >-
  One button turns the site you're on dark and remembers it. Shadeflip is six files and under 20 KB,
  and it leaves nothing on the page for LinkedIn's extension...
url: https://expiredqueues.com/shadeflip-dark-reader-firefox-chrome-extension/
markdown: https://expiredqueues.com/shadeflip-dark-reader-firefox-chrome-extension/index.md
date: '2026-10-01T09:00:00.000Z'
image: https://expiredqueues.com/images/og/shadeflip-dark-reader-firefox-chrome-extension-76542976.jpg
---

Developer Tools posts tools

# A lightweight theme toggle extension that's better than Dark Reader

1 October 2026 By Adrian Noel 5 min read

On this page

1. [What it does](#what-it-does)
2. [Trick 1: invert the whole page, then invert photos and media back](#trick-1-invert-the-whole-page-then-invert-photos-and-media-back)
3. [Trick 2: check whether the page is already dark](#trick-2-check-whether-the-page-is-already-dark)
4. [Trick 3: avoid the white flash on load](#trick-3-avoid-the-white-flash-on-load)
5. [Staying out of website fingerprinting](#staying-out-of-website-fingerprinting)
6. [About Dark Reader](#about-dark-reader)
7. [Try it](#try-it)

I switch websites between light and dark depending on the light in my room. I wanted an extension that does only that and remembers my choice for each site. The extensions I tried, such as Dark Reader, did a lot more. So I wrote Shadeflip.

- Website: [shadeflip.com](https://shadeflip.com)
- Source: [github.com/nxame/shadeflip](https://github.com/nxame/shadeflip)
- Chrome Web Store: [Shadeflip](https://chromewebstore.google.com/detail/shadeflip/nbdfmpknchaboakjefemnlkfffjohkjk)

It also stays out of website fingerprinting. Take that, LinkedIn.

## What it does

Click the toolbar button, or press Alt+Shift+D (Option+Shift+D on a Mac). The current site switches between light and dark. Shadeflip saves the choice for that address.

To get dark on all sites, set dark as the default. Then switch back the few sites that look better light.

## Trick 1: invert the whole page, then invert photos and media back

Recoloring every element on a page takes work and breaks on some sites. Shadeflip applies one CSS filter to the root element:

```css
html[data-xxxxxxxxxx] {
  filter: invert(1) hue-rotate(180deg) !important;
}
```

`invert(1)` turns white into black. It also turns blue links yellow. `hue-rotate(180deg)` turns the hues back, so blue stays roughly blue.

Photos and video come out as negatives. Shadeflip applies the same filter to them a second time, which roughly cancels it:

```css
html[data-xxxxxxxxxx] :is(img, video, canvas, iframe, embed, object, svg image, [style*="background-image"]) {
  filter: invert(1) hue-rotate(180deg) !important;
}
```

### Two side effects

This works on nearly every site. It has two side effects:

- Some colors drift. A brand's exact orange won't survive the round trip.
- A filter on the whole page can slow scrolling on very heavy pages.

In return, every site has both a dark and a light theme. Many sites I visit don't have a dark theme of their own.

## Trick 2: check whether the page is already dark

Say dark is your default and a site already has a dark theme. Inverting it would make it light. So Shadeflip looks at the page before it flips anything:

1. It picks five points on the screen: the center and four points around it.
2. It asks the browser which element is at each point.
3. For each element, it walks up the tree until it finds a background color.
4. It works out the color's relative luminance. WCAG uses the same measure for contrast.

If most of the five points are dark, the page counts as dark. Shadeflip leaves it alone.

Modern CSS has many color formats, including `oklch()` and `color()`. Shadeflip doesn't parse them. It paints the color into a 1×1 canvas and reads the pixel back. The browser does the conversion.

## Trick 3: avoid the white flash on load

A white flash on every page load defeats the point of dark mode.

Shadeflip's script starts at `document_start`, before the page has any content. For sites you've set, it stores whether the page looked dark or light last time. It reads that value from extension storage as the page starts loading. On most loads it applies the flip before the page appears, without measuring first.

The main flip rules come from the background script, which takes a moment. Until they arrive, Shadeflip puts the same invert filter inline on the `<html>` element. It removes the inline filter once the rules are in. For that moment photos are negatives, which is less jarring than a white page.

Some sites switch their own theme after load. Shadeflip watches three attributes on `<html>` and `<body>`: `class`, `style` and `data-theme`. It also watches the system's light or dark setting. When any of them change, it checks the page again.

## Staying out of website fingerprinting

In April 2026, BleepingComputer reported that [LinkedIn scans for more than 6,000 Chrome extensions](https://www.bleepingcomputer.com/news/security/linkedin-secretly-scans-for-6-000-plus-chrome-extensions-collects-data/) when you visit in a Chromium browser. The results go into a device fingerprint, along with details such as your CPU cores, memory, screen size and time zone. LinkedIn told BleepingComputer it uses the scan to protect the platform and its users.

The scan relies on a manifest field called `web_accessible_resources`. Extensions list files there so web pages can load them. LinkedIn's script tries to fetch a known file from each extension's `chrome-extension://` address. If the fetch works, that extension is installed.

[BrowserGate's write-up](https://browsergate.eu/how-it-works/) describes a second pass. It looks for traces that extensions leave in the page, such as `chrome-extension://` links.

Shadeflip gives neither pass anything to find:

- **Manifest:** it lists no web-accessible resources. There's no `chrome-extension://` file for a page to fetch.
- **Page marker:** to mark a flipped page, Shadeflip adds an attribute to `<html>`. The name is ten random letters. Shadeflip generates it on every page load and never stores it. The flip rules key on that name.
- **Stylesheet:** the flip rules go only into pages you've flipped. They go in through the browser's `scripting.insertCSS` API, so they never appear as a `<style>` tag in the page.

Dark Reader sets a [`data-darkreader-scheme` attribute](https://github.com/darkreader/darkreader/discussions/12107) on `<html>`. The name is the same on every site, so any site can check for it.

There are limits. A flipped page can see an invert filter on its root element and an unfamiliar attribute. It could guess that some dark mode extension is running. No fixed name points to Shadeflip, and nothing carries over from one site or one visit to the next.

## About Dark Reader

Dark Reader is open source, and a lot of people rely on it. It has sliders for brightness, contrast, sepia and grayscale. It has per-site color settings. It also has a "Pay for using Dark Reader" banner, and people who have already paid [have asked for a way to hide it](https://github.com/darkreader/darkreader/issues/13944).

I've never wanted to read a news site in sepia. Shadeflip has one button and no payment banner.

## Try it

- Chrome, Edge, Brave and other Chromium browsers: install from the [Chrome Web Store](https://chromewebstore.google.com/detail/shadeflip/nbdfmpknchaboakjefemnlkfffjohkjk).
- Firefox: install from [Firefox Add-ons](https://addons.mozilla.org/firefox/addon/shadeflip/).

The code is short enough to read in one sitting. The [How it works page](https://shadeflip.com/how-it-works.html) lists every permission and what it's for. If a site looks wrong, [open an issue](https://github.com/nxame/shadeflip/issues).

**Expired Queues is on YouTube.** Short videos on the same topics as this blog.

[Watch on YouTube](https://www.youtube.com/@expiredqueues)

[Previously The most-read thing I ever wrote is a Stack Overflow answer](https://expiredqueues.com/most-read-thing-i-wrote/index.md)

## Structured data

```json
{
  "@context": "https://schema.org",
  "@type": "BlogPosting",
  "headline": "A lightweight theme toggle extension that's better than Dark Reader",
  "description": "One button turns the site you're on dark and remembers it. Shadeflip is six files and under 20 KB, and it leaves nothing on the page for LinkedIn's extension...",
  "datePublished": "2026-10-01T09:00:00.000Z",
  "dateModified": "2026-10-01T09:00:00.000Z",
  "author": {
    "@type": "Person",
    "name": "Adrian Noel",
    "url": "https://expiredqueues.com/about/"
  },
  "publisher": {
    "@type": "Person",
    "name": "Adrian Noel"
  },
  "mainEntityOfPage": "https://expiredqueues.com/shadeflip-dark-reader-firefox-chrome-extension/",
  "keywords": "posts, tools, browsers, chrome, firefox, privacy, open-source",
  "articleSection": "Developer Tools"
}
```
