[tor-commits] [Git][tpo/applications/tor-browser][tor-browser-128.2.0esr-14.0-1] fixup! Bug 7494: Create local home page for TBB.

morgan (@morgan) git at gitlab.torproject.org
Tue Aug 27 21:15:54 UTC 2024



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/e8eefc2544e50ec8a812e738c6a9540b5292f0d0

-- 
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/e8eefc2544e50ec8a812e738c6a9540b5292f0d0
You're receiving this email because of your account on gitlab.torproject.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.torproject.org/pipermail/tor-commits/attachments/20240827/013457c8/attachment-0001.htm>


More information about the tor-commits mailing list