Skip to content
Stylize CodeMirror tokens
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
tokens.css
variables.css

README.md

codemirror-theme-template

Create a CodeMirror syntax theme based on a set of CSS variables.

<link rel="stylesheet" href="variables.css">
<link rel="stylesheet" href="tokens.css">

Instructions

Specify your colors (see variables.css):

/* dark.css */

.CodeMirror.cm-s-dark {
  --cm-atom       : hsl(39, 67%, 69%);
  --cm-attribute  : hsl(39, 67%, 69%);
  --cm-background : hsl(220, 10%, 18%);
  --cm-bracket    : hsl(355, 65%, 65%);
  --cm-builtin    : hsl(0, 0%, 40%);
  /* etc. */
}

Initialize CodeMirror:

CodeMirror(element, {
  theme: 'dark'
})
You can’t perform that action at this time.