Commit d0081130 authored by Stanca Serban's avatar Stanca Serban
Browse files

Backed out changeset a544e102fa0e (bug 1781829) for causing mochitests...

Backed out changeset a544e102fa0e (bug 1781829) for causing mochitests failures in browser_ext_themes_ntp_colors.js. CLOSED TREE
parent 31a741ef
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -151,7 +151,7 @@
      addEventListener("LightweightTheme:Set", this);

      // We don't sync default theme attributes in `init()`, as we may not have
      // a root element to attach the attribute to yet. They will be set when
      // a body element to attach the attribute to yet. They will be set when
      // the first LightweightTheme:Set event is delivered during pageshow.
      prefersDarkQuery.addEventListener("change", this);
    },
@@ -162,19 +162,20 @@
     * @param {Object} event object containing the theme or query update.
     */
    handleEvent(event) {
      const root = document.documentElement;
      // XUL documents don't have a body
      const element = document.body ? document.body : document.documentElement;

      if (event.type == "LightweightTheme:Set") {
        let { data } = event.detail;
        if (!data) {
          data = {};
        }
        this._setProperties(root, data);
        this._setProperties(element, data);
      } else if (event.type == "change") {
        // If a lightweight theme doesn't apply, update lwt-newtab-brighttext to
        // reflect prefers-color-scheme.
        if (!root.hasAttribute("lwt-newtab")) {
          root.toggleAttribute("lwt-newtab-brighttext", event.matches);
        if (!element.hasAttribute("lwt-newtab")) {
          element.toggleAttribute("lwt-newtab-brighttext", event.matches);
        }
      }
    },
+6 −5
Original line number Diff line number Diff line
@@ -39,6 +39,9 @@
  font-size: 15px;
  /* override --in-content-page-background from common-shared.css */
  background-color: transparent;
}

body {
  --fxview-background-color: var(--newtab-background-color, var(--in-content-page-background));
  --fxview-element-background-hover: color-mix(in srgb, var(--fxview-background-color) 90%, currentColor);
  --fxview-element-background-active: color-mix(in srgb, var(--fxview-background-color) 80%, currentColor);
@@ -55,9 +58,7 @@
  --in-content-button-background-hover: var(--fxview-element-background-hover);
  --in-content-button-background-active: var(--fxview-element-background-active);
  --in-content-button-text-color-hover: var(--fxview-text-color-hover);
}

body {
  display: flex;
  justify-content: center;
  padding-block: var(--header-spacing) var(--footer-spacing);
@@ -68,12 +69,12 @@ body {
  color: var(--newtab-text-primary-color);
}

:root:not([lwt-newtab]) {
body:not([lwt-newtab]) {
  --in-content-zap-gradient: linear-gradient(90deg, #9059FF 0%, #FF4AA2 52.08%, #FFBD4F 100%);
}

@media (prefers-color-scheme: dark) {
  :root {
  body {
    --fxview-element-background-hover: color-mix(in srgb, var(--fxview-background-color) 80%, white);
    --fxview-element-background-active: color-mix(in srgb, var(--fxview-background-color) 60%, white);
    --newtab-background-color-secondary: #42414d;
@@ -81,7 +82,7 @@ body {
}

@media (prefers-contrast) {
  :root {
  body {
    --fxview-element-background-hover: ButtonText;
    --fxview-element-background-active: ButtonText;
    --fxview-text-color-hover: ButtonFace;
+2 −2
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ $shadow-card: 0 2px 6px rgba(0, 0, 0, 0.15);
$shadow-image-inset: inset 0 0 0 0.5px $black-15;

// Default theme
:root {
body {
  // General styles
  --newtab-background-color: #{$in-content-page-background};
  --newtab-background-color-secondary: #{$newtab-background-secondary};
@@ -93,7 +93,7 @@ $shadow-image-inset: inset 0 0 0 0.5px $black-15;
}

@media (prefers-contrast) {
  :root {
  body {
    --newtab-text-secondary-color: var(--newtab-text-primary-color);
  }
}
+3 −3
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ input {
  display: none !important;
}

:root {
body {
  --newtab-background-color: #F9F9FB;
  --newtab-background-color-secondary: #FFF;
  --newtab-text-primary-color: #15141a;
@@ -63,7 +63,7 @@ input {
  --newtab-textbox-focus-boxshadow: 0 0 0 1px var(--newtab-primary-action-background), 0 0 0 4px rgba(var(--newtab-primary-action-background), 0.3);
  --newtab-button-secondary-color: inherit;
}
:root[lwt-newtab-brighttext] {
body[lwt-newtab-brighttext] {
  --newtab-background-color: #2B2A33;
  --newtab-background-color-secondary: #42414d;
  --newtab-text-primary-color: #fbfbfe;
@@ -84,7 +84,7 @@ input {
}

@media (prefers-contrast) {
  :root {
  body {
    --newtab-text-secondary-color: var(--newtab-text-primary-color);
  }
}
+3 −3
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ input {
  display: none !important;
}

:root {
body {
  --newtab-background-color: #F9F9FB;
  --newtab-background-color-secondary: #FFF;
  --newtab-text-primary-color: #15141a;
@@ -67,7 +67,7 @@ input {
  --newtab-textbox-focus-boxshadow: 0 0 0 1px var(--newtab-primary-action-background), 0 0 0 4px rgba(var(--newtab-primary-action-background), 0.3);
  --newtab-button-secondary-color: inherit;
}
:root[lwt-newtab-brighttext] {
body[lwt-newtab-brighttext] {
  --newtab-background-color: #2B2A33;
  --newtab-background-color-secondary: #42414d;
  --newtab-text-primary-color: #fbfbfe;
@@ -88,7 +88,7 @@ input {
}

@media (prefers-contrast) {
  :root {
  body {
    --newtab-text-secondary-color: var(--newtab-text-primary-color);
  }
}
Loading