Commit e8eefc25 authored by henry's avatar henry Committed by morgan
Browse files

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.
parent a8d1d771
Loading
Loading
Loading
Loading
+0 −13
Original line number Diff line number Diff line
@@ -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":
+5 −3
Original line number Diff line number Diff line
@@ -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;
  }