/* This Source Code Form is subject to the terms of the Creative Commons
 * Attribution-NonCommercial-ShareAlike International License, v. 4.0.
 * If a copy of the CC BY-NC-SA 4.0 was not distributed with this
 * file, You can obtain one at http://creativecommons.org/licenses/by-nc-sa/4.0/
 * or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. */

@import url(chrome://userchrome/content/layout/uc-low-globals.css);

pre {
  white-space: pre-wrap;
  word-wrap: break-word;
  -moz-control-character-visibility: visible;
}

.nowrap pre {
  white-space: pre;
}

/* Make text go with the rules of dir=auto, but allow it to be overriden if 'Switch Text Direction' is triggered */
html:not([dir]) pre {
  /* Not a UA sheet, so doesn't use :-moz-has-dir-attr */
  unicode-bidi: plaintext;
}

@-moz-document unobservable-document() {
  :root {
    color-scheme: light dark;
  }

  @media (prefers-color-scheme: dark) {
    :root {
      background-color: var(--in-content-bg-dark);
      color: var(--plaintext-color);
    }
  }
}

/* NOTE(emilio): For some reason some pages, mainly bing.com, load a bunch of
 * scripts in zero-size <object> elements, see bug 1548449.
 *
 * Line-breaking such documents is useless and pretty expensive, so only render
 * them if there's a viewport. Sigh.
 */
@media (width: 0) or (height: 0) {
  :root {
    display: none;
  }
}
