/**
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

$syntax-comment: darken($syntax-04, 10%);

// General colors
$syntax-text-color       : $syntax-03;
$syntax-cursor-color     : $syntax-03;
$syntax-selection-color  : $syntax-05;
$syntax-background-color : $editor-accent-bg; // $syntax-07;

// Guide colors
$syntax-wrap-guide-color          : $syntax-03;
$syntax-indent-guide-color        : $syntax-03;
$syntax-invisible-character-color : $syntax-03;

// For find and replace markers
$syntax-result-marker-color          : $syntax-03;
$syntax-result-marker-color-selected : $syntax-05;

// Gutter colors
$syntax-gutter-text-color                : $syntax-05;
$syntax-gutter-text-color-selected       : $syntax-05;
$syntax-gutter-background-color          : $syntax-00;
$syntax-gutter-background-color-selected : rgba(80, 80, 80, 0.33);

// For git diff info. i.e. in the gutter
// These are static and were not extracted from your textmate theme
// $syntax-color-renamed  : #96cbfe; // light blue
// $syntax-color-added    : #a8ff60; // bright green
// $syntax-color-modified : #e9c062; // yellow-orange
// $syntax-color-removed  : #cc6666; // dull red

%editor                        { background-color: $syntax-background-color; color: $syntax-text-color; }

// %generic                         {}
// %line-deleted                    { background-color: $syntax-background-removed; }
// %line-added                      { background-color: $syntax-background-added; }
%comment                         { color: $syntax-comment; font-style: italic; }
%comment-special                 { color: $syntax-comment; font-weight: bold; }
%comment-markup-link             { color: $syntax-comment; }
%entity-name-type                { color: $syntax-0A; }
%entity-other-inherited-class    { color: $syntax-0B; }
%keyword                         { color: $syntax-0E; }
%keyword-control                 { color: $syntax-0E; }
%keyword-operator                { color: $syntax-03; }
%keyword-other-special-method    { color: $syntax-0D; }
%keyword-other-unit              { color: $syntax-09; }
%storage,
%storage-type-annotation,
%storage-type-primitive          { color: $syntax-0E; }
%storage-modifier-package,
%storage-modifier-import         { color: $syntax-05; }
%constant                        { color: $syntax-09; }
%constant-variable               { color: $syntax-09; }
%constant-character-escape       { color: $syntax-0C; }
%constant-numeric                { color: $syntax-09; }
%constant-other-color            { color: $syntax-0C; }
%constant-other-symbol           { color: $syntax-0B; }
%variable                        { color: $syntax-08; }
%variable-interpolation          { color: $syntax-0F; }
%variable-parameter              { color: $syntax-05; }
%string                          { color: $syntax-0B; }
%string-regexp                   { color: $syntax-0C; }
%string-other-link               { color: $syntax-08; }
%punctuation-definition-comment  { color: $syntax-03; }
%punctuation-method-parameters,
%punctuation-function-parameters,
%punctuation-parameters,
%punctuation-separator,
%punctuation-seperator,
%punctuation-array               { color: $syntax-05; }
%punctuation-heading,
%punctuation-identity            { color: $syntax-0D; }
%punctuation-bold                { color: $syntax-0A; font-weight: bold; }
%punctuation-italic              { color: $syntax-0E; font-style: italic; }
%punctuation-section-embedded    { color: $syntax-0F; }
%punctuation-section-method,
%punctuation-section-class,
%punctuation-section-inner-class { color: $syntax-05; }
%support-class                   { color: $syntax-0A; }
%support-type                    { color: $syntax-0C; }
%support-function                { color: $syntax-0C; }
%support-function-any-method     { color: $syntax-0D; }
%entity-name-function            { color: $syntax-0D; }
%entity-name-class,
%entity-name-type-class          { color: $syntax-0A; }
%entity-name-section             { color: $syntax-0D; }
%entity-name-tag                 { color: $syntax-08; }
%entity-other-attribute-name     { color: $syntax-09; }
%entity-other-attribute-name-id  { color: $syntax-0D; }
%meta-class                      { color: $syntax-07; }
%meta-class-body                 { color: $syntax-05; }
%meta-method-call,
%meta-method                     { color: $syntax-05; }
%meta-definition-variable        { color: $syntax-08; }
%meta-link                       { color: $syntax-09; }
%meta-require                    { color: $syntax-0D; }
%meta-selector                   { color: $syntax-0E; }
%meta-separator                  { color: $syntax-05; background-color: #373b41; }
%meta-tag                        { color: $syntax-05; }
%underline                       { text-decoration: underline; }
%none                            { color: $syntax-05; }
// %invalid-deprecated { color: $syntax-deprecated-fg !important; background-color: $syntax-deprecated-bg !important; }
%invalid-illegal    { color: $syntax-00 !important; background-color: $syntax-08 !important; }

%idk-wtf-this-is {
  display: inline-block;
  transform: scale(1.5);
  background: red;
  color: white;

  &::after {
    content: "!!!THIS IS A BUG, PLEASE REPORT IT!!!";
  }
}

/**
 * Pygments
 */

.article {

  .highlight      { @extend %editor; }
  .highlight .err { @extend %invalid-illegal;                  } /* Error */

  .highlight .c   { @extend %comment;                          } /* Comment: Token type for any comment. */
  .highlight .cm  { @extend %comment;                          } /* Comment.Multiline: Token type for multiline comments. */
  .highlight .cp  { @extend %comment-special;                  } /* Comment.Preproc: Token type for preprocessor comments (also ``<?php``/``<%`` constructs). */
  .highlight .c1  { @extend %comment;                          } /* Comment.Single: Token type for comments that end at the end of a line (e.g. ``# foo``). */
  .highlight .cs  { @extend %comment-special;                  } /* Comment.Special: Special data in comments. For example code tags, author and license information, etc. */

  // .highlight .gd  { @extend %line-deleted;                     } /* Generic.Deleted: Marks the token value as deleted. */
  .highlight .ge  { @extend %punctuation-italic;               } /* Generic.Emph: Marks the token value as emphasized. */
  .highlight .gr  { @extend %invalid-illegal;                  } /* Generic.Error: Marks the token value as an error message. */
  .highlight .gh  { @extend %punctuation-heading;              } /* Generic.Heading: Marks the token value as headline. */
  // .highlight .gi  { @extend %line-added;                       } /* Generic.Inserted: Marks the token value as inserted. */
  .highlight .go  { @extend %idk-wtf-this-is;                  } /* Generic.Output: Marks the token value as program output (e.g. for python cli lexer). */
  .highlight .gp  { @extend %comment;                          } /* Generic.Prompt: Marks the token value as command prompt (e.g. bash lexer). */
  .highlight .gs  { @extend %punctuation-bold;                 } /* Generic.Strong: Marks the token value as bold (e.g. for rst lexer). */
  .highlight .gu  { @extend %idk-wtf-this-is;                  } /* Generic.Subheading: Marks the token value as subheadline. */
  .highlight .gt  { @extend %idk-wtf-this-is;                  } /* Generic.Traceback: Marks the token value as a part of an error traceback. */

  .highlight .k   { @extend %keyword;                          } /* Keyword: For any kind of keyword (especially if it doesn't match any of the subtypes of course). */
  .highlight .kc  { @extend %constant;                         } /* Keyword.Constant: For keywords that are constants (e.g. ``None`` in future Python versions). */
  .highlight .kd  { @extend %storage;                          } /* Keyword.Declaration: For keywords used for variable declaration (e.g. ``var`` in some programming languages like JavaScript). */
  .highlight .kn  { @extend %keyword;                          } /* Keyword.Namespace: For keywords used for namespace declarations (e.g. ``import`` in Python and Java and ``package`` in Java). */
  .highlight .kp  { @extend %keyword;                          } /* Keyword.Pseudo: For keywords that aren't really keywords (e.g. ``None`` in old Python versions). */
  .highlight .kr  { @extend %keyword;                          } /* Keyword.Reserved: For reserved keywords. */
  .highlight .kt  { @extend %keyword;                          } /* Keyword.Type: For builtin types that can't be used as identifiers (e.g. ``int``, ``char`` etc. in C). */

  /* Literal: For any literal (if not further defined). */

  .highlight .na  { @extend %entity-other-attribute-name;      } /* Name.Attribute: For all attributes (e.g. in HTML tags). */
  .highlight .nb  { @extend %variable;                         } /* Name.Builtin: Builtin names; names that are available in the global namespace. */
  .highlight .bp  { @extend %variable;                         } /* Name.Builtin.Pseudo: Builtin names that are implicit (e.g. ``self`` in Ruby, ``this`` in Java). */
  .highlight .nc  { @extend %entity-name-type-class;           } /* Name.Class: Class names. Because no lexer can know if a name is a class or a function or something else this token is meant for class declarations. */
  .highlight .no  { @extend %constant-other-color;             } /* Name.Constant: Token type for constants. In some languages you can recognise a token by the way it's defined (the value after a ``const`` keyword for example). In other languages constants are uppercase by definition (Ruby). */
  .highlight .nd  { @extend %variable;                         } /* Name.Decorator: Token type for decorators. Decorators are syntactic elements in the Python language. Similar syntax elements exist in C# and Java. */
  .highlight .ni  { @extend %constant;                         } /* Name.Entity: Token type for special entities. (e.g. ``&nbsp;`` in HTML). */
  .highlight .nf  { @extend %entity-name-function;             } /* Name.Function: Token type for function names. */
  .highlight .nn  { @extend %entity-name-type-class;           } /* Name.Namespace: Token type for namespaces. (e.g. import paths in Java/Python), names following the ``module``/``namespace`` keyword in other languages. */
  .highlight .nt  { @extend %entity-name-tag;                  } /* Name.Tag: Tag names (in HTML/XML markup or configuration files). */
  .highlight .nv  { @extend %variable;                         } /* Name.Variable: Token type for variables. Some languages have prefixes for variable names (PHP, Ruby, Perl). You can highlight them using this token. */
  .highlight .vc  { @extend %variable;                         } /* Name.Variable.Class: same as `Name.Variable` but for class variables (also static variables). */
  .highlight .vg  { @extend %variable;                         } /* Name.Variable.Global: same as `Name.Variable` but for global variables (used in Ruby, for example). */
  .highlight .vi  { @extend %variable;                         } /* Name.Variable.Instance: same as `Name.Variable` but for instance variables. */

  .highlight .o   { @extend %keyword-operator;                 } /* Operator: For any punctuation operator (e.g. ``+``, ``-``). */
  .highlight .ow  { @extend %keyword-operator;                 } /* Operator.Word: For any operator that is a word (e.g. ``not``). */

  // .highlight .w   { color: #bbbbbb                             } /* Text.Whitespace */

  .highlight .m   { @extend %constant-numeric;                 } /* Number: Token type for any number literal. */
  .highlight .mf  { @extend %constant-numeric;                 } /* Number.Float: Token type for float literals (e.g. ``42.0``). */
  .highlight .mh  { @extend %constant-numeric;                 } /* Number.Hex: Token type for hexadecimal number literals (e.g. ``0xdeadbeef``). */
  .highlight .mi  { @extend %constant-numeric;                 } /* Number.Integer: Token type for integer literals (e.g. ``42``). */
  .highlight .il  { @extend %constant-numeric;                 } /* Number.Integer.Long: Token type for long integer literals (e.g. ``42L`` in Python). */
  .highlight .mo  { @extend %constant-numeric;                 } /* Number.Oct: Token type for octal literals. */

  .highlight .s   { @extend %string;                           } /* String: For any string literal. */
  .highlight .sb  { @extend %string;                           } /* String.Backtick: Token type for strings enclosed in backticks. */
  .highlight .sc  { @extend %string;                           } /* String.Char: Token type for single characters (e.g. Java, C). */
  .highlight .sd  { @extend %string;                           } /* String.Doc: Token type for documentation strings (for example Python). */
  .highlight .s2  { @extend %string;                           } /* String.Double: Double quoted strings. */
  .highlight .se  { @extend %constant-character-escape;        } /* String.Escape: Token type for escape sequences in strings. */
  .highlight .sh  { @extend %string;                           } /* String.Heredoc: Token type for "heredoc" strings (e.g. in Ruby or Perl). */
  .highlight .si  { @extend %punctuation-section-embedded;     } /* String.Interpol: Token type for interpolated parts in strings (e.g. ``#{foo}`` in Ruby). */
  .highlight .sx  { @extend %string;                           } /* String.Other: Token type for any other strings (for example ``%q{foo}`` string constructs in Ruby). */
  .highlight .sr  { @extend %string-regexp;                    } /* String.Regex: Token type for regular expression literals (e.g. ``/foo/`` in JavaScript). */
  .highlight .s1  { @extend %string;                           } /* String.Single: Token type for single quoted strings. */
  .highlight .ss  { @extend %constant-other-symbol;            } /* String.Symbol: Token type for symbols (e.g. ``:foo`` in LISP or Ruby). */

  // --------------------------------------


  /* Comment */
  /* pygments uses .err, which we leave unstyled because pygments doesn't parse
    types, so there are lots of spurious "errors". */
  .highlight .T_ERROR { @extend .err; }

  .highlight .T_ASYNC,
  .highlight .T_AWAIT,
  .highlight .T_BREAK,
  .highlight .T_CASE,
  .highlight .T_CATCH,
  .highlight .T_CONTINUE,
  .highlight .T_DEBUGGER,
  .highlight .T_DECLARE,
  .highlight .T_DEFAULT,
  .highlight .T_DELETE,
  .highlight .T_DO,
  .highlight .T_ELSE,
  .highlight .T_ENUM,
  .highlight .T_EXPORT,
  .highlight .T_EXTENDS,
  .highlight .T_FINALLY,
  .highlight .T_FOR,
  .highlight .T_IF,
  .highlight .T_IMPLEMENTS,
  .highlight .T_IMPORT,
  .highlight .T_IN,
  .highlight .T_INSTANCEOF,
  .highlight .T_INTERFACE,
  .highlight .T_NEW,
  .highlight .T_OF,
  .highlight .T_PACKAGE,
  .highlight .T_PRIVATE,
  .highlight .T_PROTECTED,
  .highlight .T_PUBLIC,
  .highlight .T_RETURN,
  .highlight .T_STATIC,
  .highlight .T_SUPER,
  .highlight .T_SWITCH,
  .highlight .T_THIS,
  .highlight .T_THROW,
  .highlight .T_TRY,
  .highlight .T_TYPE,
  .highlight .T_TYPEOF,
  .highlight .T_VOID,
  .highlight .T_WHILE,
  .highlight .T_WITH,
  .highlight .T_YIELD {
    @extend .k;
  }

  .highlight .T_AND,
  .highlight .T_ASSIGN,
  .highlight .T_BIT_AND,
  .highlight .T_BIT_AND_ASSIGN,
  .highlight .T_BIT_NOT,
  .highlight .T_BIT_OR,
  .highlight .T_BIT_OR_ASSIGN,
  .highlight .T_BIT_XOR,
  .highlight .T_BIT_XOR_ASSIGN,
  .highlight .T_COLON,
  .highlight .T_DECR,
  .highlight .T_DIV_ASSIGN,
  .highlight .T_EQUAL,
  .highlight .T_GREATER_THAN_EQUAL,
  .highlight .T_INCR,
  .highlight .T_LESS_THAN_EQUAL,
  .highlight .T_LSHIFT,
  .highlight .T_LSHIFT_ASSIGN,
  .highlight .T_MINUS,
  .highlight .T_MINUS_ASSIGN,
  .highlight .T_MOD,
  .highlight .T_MOD_ASSIGN,
  .highlight .T_MULT,
  .highlight .T_MULT_ASSIGN,
  .highlight .T_NOT,
  .highlight .T_NOT_EQUAL,
  .highlight .T_OR,
  .highlight .T_PLING,
  .highlight .T_PLUS,
  .highlight .T_PLUS_ASSIGN,
  .highlight .T_RSHIFT,
  .highlight .T_RSHIFT3,
  .highlight .T_RSHIFT3_ASSIGN,
  .highlight .T_RSHIFT_ASSIGN,
  .highlight .T_STRICT_EQUAL,
  .highlight .T_STRICT_NOT_EQUAL,
  .highlight .T_DIV.normal,
  .highlight .T_GREATER_THAN.normal,
  .highlight .T_LESS_THAN.normal {
    @extend .o;
  }

  .comment {
    @extend .cm;
  }

  .highlight .T_CLASS,
  .highlight .T_CONST,
  .highlight .T_FUNCTION,
  .highlight .T_LET,
  .highlight .T_VAR {
    @extend .kd;
  }

  .highlight .T_ANY_TYPE,
  .highlight .T_BOOLEAN_TYPE,
  .highlight .T_NUMBER_TYPE,
  .highlight .T_STRING_TYPE,
  .highlight .T_VOID_TYPE {
    @extend .kt;
  }

  .highlight .T_NUMBER {
    @extend .m;
  }

  .highlight .T_IDENTIFIER.type,
  .highlight .T_JSX_IDENTIFIER.type {
    @extend .nc;
  }

  .highlight .T_IDENTIFIER,
  .highlight .T_JSX_IDENTIFIER {
    @extend .nv;
  }

  .highlight .T_JSX_TEXT {
    @extend .sb;
  }

  .highlight .T_REGEXP {
    @extend .sr;
  }

  .highlight .T_STRING,
  .highlight .T_TEMPLATE_PART {
    @extend .s1;
  }

  // ----------------------------------------------------------------------------

  .highlight span.cm-header      { }
  .highlight span.cm-quote       { }
  // .highlight span.cm-negative    { @extend %line-deleted; }
  // .highlight span.cm-positive    { @extend %line-added; }
  .highlight span.cm-keyword     { @extend %keyword; }
  .highlight span.cm-atom        { }
  .highlight span.cm-number      { @extend %constant-numeric; }
  .highlight span.cm-def         { @extend %variable; }
  .highlight span.cm-variable    { @extend %variable; }
  .highlight span.cm-punctuation { }
  .highlight span.cm-property    { @extend %variable; }
  .highlight span.cm-operator    { @extend %keyword-operator; };
  .highlight span.cm-variable-2  { @extend %variable; }
  .highlight span.cm-variable-3  { @extend %keyword; }
  .highlight span.cm-comment     { @extend %comment; }
  .highlight span.cm-string      { @extend %string; }
  .highlight span.cm-string-2    { @extend %string; }
  .highlight span.cm-meta        { }
  .highlight span.cm-qualifier   { @extend %entity-name-type-class;; }
  .highlight span.cm-builtin     { }
  .highlight span.cm-bracket     { }
  .highlight span.cm-tag         { @extend %entity-name-tag; }
  .highlight span.cm-attribute   { @extend %entity-other-attribute-name; }
  .highlight span.cm-hr          { }
  .highlight span.cm-link        { }

  .highlight span.cm-error       { @extend %invalid-illegal; }
  .highlight span.cm-invalidchar { @extend %invalid-illegal; }

}
