morgan pushed to branch tor-browser-128.2.0esr-14.0-1 at The Tor Project / Applications / Tor Browser
Commits: e8eefc25 by Henry Wilkes at 2024-08-27T21:12:40+00:00 fixup! Bug 7494: Create local home page for TBB.
Bug 42744: Stop using prefersColorSchemeOverride for about:tor.
common-shared.css seems to have simplified since the original implementation, so we can simply set the `color-scheme` and `color` on the search form to keep the styling consistent in both light and dark themes.
- - - - -
2 changed files:
- browser/components/abouttor/AboutTorChild.sys.mjs - browser/components/abouttor/content/aboutTor.css
Changes:
===================================== browser/components/abouttor/AboutTorChild.sys.mjs ===================================== @@ -2,19 +2,6 @@ * Actor child class for the about:tor page. */ export class AboutTorChild extends JSWindowActorChild { - actorCreated() { - if (this.contentWindow.matchMedia("not (prefers-contrast)").matches) { - // When prefers-contrast is not set, the page only has one style because - // we always set a dark background and a light <form>. - // We force prefers-color-scheme to be light, regardless of the user's - // settings so that we inherit the "light" theme styling from - // in-content/common.css for the <form> element. In particular, we want - // the light styling for the <input> and <moz-toggle> elements, which are - // on a light background. - this.browsingContext.prefersColorSchemeOverride = "light"; - } - } - handleEvent(event) { switch (event.type) { case "DOMContentLoaded":
===================================== browser/components/abouttor/content/aboutTor.css ===================================== @@ -180,15 +180,17 @@ body:not(.show-tor-check) #tor-check {
body > :not(#search-form) { /* Same as --in-content-page-color when "prefers-color-scheme: dark" */ - --in-content-page-color: #fbfbfe; - --in-content-text-color: #fbfbfe; - color: var(--in-content-text-color); + color: var(--color-gray-05); --link-color: var(--tor-link-color-dark); --link-color-hover: var(--tor-link-color-hover-dark); --link-color-active: var(--tor-link-color-active-dark); }
#search-form { + /* Use light color for background and moz-toggle shadow root. */ + color-scheme: light; + /* Same as --in-content-page-color when "prefers-color-scheme: light" */ + color: var(--color-gray-100); border-color: transparent; }
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/e8eefc25...
tbb-commits@lists.torproject.org