/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* Tor Browser instructions
 * ========================
 *
 * DO NOT EDIT this file directly!
 *
 * DO NOT MANUALLY RESOLVE MERGE CONFLICTS for this file!
 *
 * This is a file generated by `./mach buildtokens`.
 *
 * When resolving conflicts, first resolve other conflicts outside the
 * 'dist' directory, if there are any:
 *   git mergetool ':(exclude)toolkit/themes/shared/design-system/dist/'
 *
 * Then regenerate these 'dist' files:
 *
 *   ./mach buildtokens
 *
 * Then add the generated files as resolved:
 *
 *   git add toolkit/themes/shared/design-system/dist/
 */
/* DO NOT EDIT this file directly, instead modify moz-urlbarview.tokens.json
 * and run `mach buildtokens` to see your changes. */

@layer tokens-foundation, tokens-browser-theme, tokens-foundation-brand, tokens-foundation-nova, tokens-browser-theme-nova, tokens-foundation-brand-nova, tokens-prefers-contrast, tokens-prefers-contrast-nova, tokens-forced-colors, tokens-forced-colors-nova;

@layer tokens-foundation {
  :root,
  :host {
    --urlbarview-background-color-hover: var(--background-color-dimmed);
    --urlbarview-background-color-selected: SelectedItem;
    --urlbarview-border-radius: calc(var(--button-border-radius) + 2px);
    --urlbarview-separator-color: color-mix(in srgb, currentColor 14%, transparent);
    --urlbarview-text-color-action: LinkText;
    --urlbarview-text-color-selected: SelectedItemText;
  }
}

/* Bug 1879900: Can't nest media queries inside of :host, :root selector
   until Bug 1879349 lands */
@layer tokens-prefers-contrast {
  @media (prefers-contrast) {
    :root,
    :host {
      --urlbarview-separator-color: color-mix(in srgb, currentColor 86%, transparent);
    }
  }
}

/* Bug 1879900: Can't nest media queries inside of :host, :root selector
   until Bug 1879349 lands */
@layer tokens-browser-theme {
  @media not ((forced-colors) or (-moz-native-theme)) {
    :root:not([lwtheme]),
    :host(.anonymous-content-host) {
      --urlbarview-background-color-hover: light-dark(rgb(240, 240, 244), var(--background-color-dimmed));
      --urlbarview-background-color-selected: light-dark(#e0e0e6, rgb(43, 42, 51));
      --urlbarview-separator-color: light-dark(rgb(240, 240, 244), rgb(82, 82, 94));
      --urlbarview-text-color-action: light-dark(rgb(91, 91, 102), rgb(191, 191, 201));
      --urlbarview-text-color-selected: light-dark(rgb(21, 20, 26), rgb(251, 251, 254));
    }
  }
}

@media -moz-pref("browser.nova.enabled") {
  @layer tokens-foundation-nova {
    :root,
    :host {
      /* TODO Bug 2031910: Finalize the border radius for Nova. */
      --urlbarview-border-radius: 1.8462em;
    }
  }
}
