/* Colors for shell code blocks (bash, sh, zsh, ...). static/scripts/library/bash_highlight.js
   tags the commands, flags, paths and constants that Chroma leaves as bare text and adds
   `bash-hl` to the <code> once it is done; every rule here is scoped to that, so no other
   language changes. The selectors are more specific than the generic Chroma ones in
   syntax_highlight.css because footer.html's C++ pass also runs over these blocks and can add
   stray classes (a capitalized variable becomes a "type"). */

body {
    --bash-cmd: var(--vscode-function);
    --bash-sub: var(--vscode-control-keyword);
    --bash-decl: var(--vscode-keyword);
    --bash-flag: #0451a5;
    --bash-path: var(--vscode-type);
    --bash-const: var(--vscode-number);
    --bash-pattern: var(--vscode-string);
    --bash-subst: var(--vscode-variable);
    --bash-prompt: var(--vscode-line-number);
}

body.dark {
    --bash-flag: var(--vscode-keyword);
}

/* Chroma's own tokens, as they read in a shell */
.chroma code.bash-hl .k { color: var(--vscode-control-keyword); }
.chroma code.bash-hl .nv,
.chroma code.bash-hl .si { color: var(--vscode-variable); }
.chroma code.bash-hl .s,
.chroma code.bash-hl .s1,
.chroma code.bash-hl .s2,
.chroma code.bash-hl .sx { color: var(--vscode-string); }
.chroma code.bash-hl .cp { color: var(--vscode-comment); }

/* Roles tagged by the script. Last, so they win over a Chroma class on the same element
   (`$(` is a keyword to Chroma, a substitution here). */
.chroma code.bash-hl .bash-cmd { color: var(--bash-cmd); }
.chroma code.bash-hl .bash-sub { color: var(--bash-sub); }
.chroma code.bash-hl .bash-decl { color: var(--bash-decl); }
.chroma code.bash-hl .bash-flag { color: var(--bash-flag); }
.chroma code.bash-hl .bash-path { color: var(--bash-path); }
.chroma code.bash-hl .bash-const { color: var(--bash-const); }
.chroma code.bash-hl .bash-var { color: var(--vscode-variable); }
.chroma code.bash-hl .bash-pat { color: var(--bash-pattern); }
.chroma code.bash-hl .bash-subst { color: var(--bash-subst); }
.chroma code.bash-hl .bash-prompt { color: var(--bash-prompt); }
.chroma code.bash-hl .bash-eq { color: var(--vscode-punctuation); }
.chroma code.bash-hl .bash-arg { color: var(--vscode-text); }
