react-codemirror icon indicating copy to clipboard operation
react-codemirror copied to clipboard

Theme syntax highlighting not working

Open sreenigaddam77 opened this issue 7 years ago • 3 comments

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

sreenigaddam77 avatar Jul 30 '18 16:07 sreenigaddam77

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

marcmoo avatar Mar 12 '19 23:03 marcmoo

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( <Provider store={store}> <ThemePicker> <ErrorBoundary> <App /> </ErrorBoundary> </ThemePicker> </Provider>, document.getElementById('root') );

marcmoo avatar Mar 12 '19 23:03 marcmoo

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

danieldanielecki avatar Mar 04 '20 14:03 danieldanielecki