.CodeMirror {border: 1px solid black; font-size:13px}
CodeMirror
Home Manual Code
Theme
Theme Demo
function findSequence(goal) { function find(start, history) { if (start == goal) return history; else if (start > goal) return null; else return find(start + 5, "(" + history + " + 5)") || find(start * 3, "(" + history + " * 3)"); } return find(1, "1"); }
Select a theme: default 3024-day 3024-night abcdef ambiance base16-dark base16-light bespin blackboard cobalt colorforth darcula dracula duotone-dark duotone-light eclipse elegant erlang-dark gruvbox-dark hopscotch icecoder idea isotope lesser-dark liquibyte lucario material material-darker material-palenight material-ocean mbo mdn-like midnight monokai moxer neat neo night nord oceanic-next panda-syntax paraiso-dark paraiso-light pastel-on-dark railscasts rubyblue seti shadowfox solarized dark solarized light the-matrix tomorrow-night-bright tomorrow-night-eighties ttcn twilight vibrant-ink xq-dark xq-light yeti yonce zenburn
var editor = CodeMirror.fromTextArea(document.getElementById("code"), { lineNumbers: true, styleActiveLine: true, matchBrackets: true }); var input = document.getElementById("select"); function selectTheme() { var theme = input.options[input.selectedIndex].textContent; editor.setOption("theme", theme); location.hash = "#" + theme; } var choice = (location.hash && location.hash.slice(1)) || (document.location.search && decodeURIComponent(document.location.search.slice(1))); if (choice) { input.value = choice; editor.setOption("theme", choice); } CodeMirror.on(window, "hashchange", function() { var theme = location.hash.slice(1); if (theme) { input.value = theme; selectTheme(); } });