Skip to content

1.0.3: no Try offer on sites with a dark theme of their own - #3

Merged
QuantIntellect merged 1 commit into
mainfrom
release/1.0.3
Nov 20, 2026
Merged

QuantIntellect merged 1 commit into
mainfrom
release/1.0.3

Conversation

@QuantIntellect

Copy link
Copy Markdown
Owner

Sites whose own dark theme is switched off in their own settings no longer get the "This page is bright · Try" card or the TRY badge. YouTube set to its light theme was the report.

How it decides

Before offering, at idle after load (capped at 3 s), the top frame scans the page's readable style sheets for a dark theme rule aimed at the root:

Evidence Example
Root rule with a dark marker YouTube html[dark], Stack Overflow body.theme-dark, Wikipedia html.skin-theme-clientpref-night, html.dark body
Bare theme attribute the root carries GitHub [data-color-mode=dark] with data-color-mode on <html>
Unused dark class from a family the root carries Reddit .theme-dark beside body.theme-beta
Root colors in a matching dark media block that don't apply to the root :root:not(.theme-light)

Not counted: dark section styles (.theme-dark on a promo band on Apple, IKEA or Microsoft; .bg-dark, .btn-dark), and blocks that libraries ship to every site using them (Bootstrap 5.3 [data-bs-theme=dark], Algolia DocSearch html[data-theme=dark]), unless the site sets that attribute on its root.

Behaviour

  • Popup: Site's own dark theme is off, with Try on this page still there.
  • All bright sites and sites turned on: adapted as before. If the site's own theme is switched on, the extension steps aside as it already did.
  • The check runs only while the system is dark. With Always on a light system the offer stays, and Try uses the site's own dark CSS.
  • The card now appears after load (at most 3 s after the first check), not right after DOMContentLoaded.
  • Manifest: version only, no new permissions.

Verification

  • Unit: 21/21, including a new selector-grammar suite built from real sites' selectors.
  • Fixture e2e: 92/92, with 9 new checks: five kinds of own theme, the popup, dark sections plus library blocks, a widget-only dark block, and Always on a light system.
  • Live, with the extension loaded, dark system, default settings: YouTube (light theme), Stack Overflow and Wikipedia get no card. HN, BBC, Apple iPhone, IKEA, Microsoft, CNN, Nike and Craigslist keep it. The scan takes 1–22 ms.

Limits

  • Cross-origin style sheets aren't fetched for this check.
  • light.html no longer ships its own dark theme rule; the theme-switch check adds it, because a page that ships one no longer gets the offer.

🤖 Generated with Claude Code

https://claude.ai/code/session_0119pSNmC1KsBQ25Q5us1HoS

Sites whose own dark theme is switched off in their own settings (YouTube
set to light, Stack Overflow, Wikipedia) no longer get the "This page is
bright · Try" card or the TRY badge. Before offering, the top frame scans
the page's readable style sheets, at idle after load (capped at 3 s), for
a dark theme rule aimed at the root: html[dark], body.theme-dark,
[data-theme=dark] when the root carries data-theme, or root colors in a
matching prefers-color-scheme: dark block that the site's setting gates.

Dark section styles (.theme-dark on a promo band, .bg-dark) and blocks
libraries ship to every site (Bootstrap's [data-bs-theme=dark],
DocSearch's html[data-theme=dark]) don't count. The popup says "Site's
own dark theme is off" and keeps Try on this page. All bright sites and
sites turned on are adapted as before; the check runs only while the
system is dark.

Tests: 21 unit, 92/92 fixture e2e. Checked live with the extension:
YouTube, Stack Overflow, Wikipedia get no card; HN, BBC, Apple iPhone,
IKEA, Microsoft, CNN, Nike, Craigslist keep it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0119pSNmC1KsBQ25Q5us1HoS
@QuantIntellect
QuantIntellect merged commit 42de560 into main Nov 20, 2026
1 check passed
@QuantIntellect
QuantIntellect deleted the release/1.0.3 branch November 20, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant