JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="https://enjalot.github.io/Inlet/lib/CodeMirror3/lib/codemirror.css">
<link rel="stylesheet" href="https://enjalot.github.io/Inlet/lib/CodeMirror3/theme/monokai.css">
<link rel="stylesheet" href="https://enjalot.github.io/Inlet/inlet.css">
<script src="https://enjalot.github.io/Inlet/lib/CodeMirror3/lib/codemirror.js"></script>
<script src="https://enjalot.github.io/Inlet/inlet.js"></script>
<textarea style="display: none;" name="code" cols="5" rows="" id="code"><style>color:#3300db;</style></textarea>
JavaScript
(function(){
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
styleActiveLine: true,
lineNumbers: true,
lineWrapping: true,
viewportMargin: Infinity
});
document.getElementsByClassName('CodeMirror')[0].className += ' cm-s-monokai';
editor.on("change", changeFunction)
function changeFunction() {
var value = editor.getValue();
};
changeFunction();
var inlet = Inlet(editor);
})();