oneDarkTheme not working


I just added the oneDarkTheme from GitHub - codemirror/theme-one-dark: One Dark theme for the CodeMirror code editor to my project, and added an instance of it to the extensions of the EditorState like this let state = EditorState.create({ doc: initial_program, extensions: [keymap.of(keymaps), lintGutter(), basicSetup, EditorView.lineWrapping, oneDarkTheme] });

Only the gutter and the selected lines seems to be affected by the theme and the .cm-content remains white. I tried putting only the oneDarkTheme extension, and also tried adding the extension in the editor but this didn’t solve the issue.

Am I missing something here?

By the way, what’s the difference between adding extensions to the state and to the editor?

I don’t see a problem when I try this.

There’s no such thing as adding extensions to the editor. Extensions always live in the state.


Ok, I will try to debug this step by step, compare with my implementation and keep you up to date on what I did wrong.

Thank you

Ok, I added : .cm-editor{ display: initial !important; } in the webpage’s styles for some reason and had completely forgot about it.

Just removed it and it solved the issue.