JedWatson / react-codemirror

Codemirror Component for React.js
MIT License
1.55k stars 262 forks source link

Theme syntax highlighting not working #145

Open sreenigaddam77 opened 5 years ago

sreenigaddam77 commented 5 years ago

hi,

I have tried to apply different themes, i can see only background change working, but code syntax, keywords highlighting not working. Editor is part of webapp, could you please advise, what iam missing here image

marcmoo commented 5 years ago

same thing happens here, mode can only work with theme of 'monokai', other themes never work...

marcmoo commented 5 years ago

I got the Answer. need to import the theme css in your root file such as App.js/index.js

for example:(in our index.js) .... import 'codemirror/lib/codemirror.css'; import 'codemirror/theme/monokai.css'; import 'codemirror/theme/blackboard.css';

... ReactDOM.render(

, document.getElementById('root') );
danieldanielecki commented 4 years ago

In my case, I didn't have included one of the language-specific modes in the mode folder.