question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can not create two editor with different theme

See original GitHub issue

monaco-editor version: 0.14.2 & 0.18.1 Browser: chrome 69 OS: macOS Mojave 10.14 Playground code that reproduces the issue:

monaco.editor.create(document.getElementById("container"), {
	value: "function hello() {\n\talert('Hello world!');\n}",
        theme: 'vs-light',
	language: "javascript"
});


monaco.editor.create(document.getElementById("container1"), {
	value: "function hello() {\n\talert('Hello Monaco!');\n}",
        theme: 'vs-dark',
	language: "javascript"
});
<div id="container" style="height:30%;"></div>
<hr>
<div id="container1" style="height:30%;"></div>

屏幕快照 2019-12-18 下午7 45 58

I set dark theme and light theme, but all show dark theme

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:4
  • Comments:13

github_iconTop GitHub Comments

4reactions
yunliang-dingcommented, Jan 21, 2020

You can try… const ed1 = monaco.editor const ed2 = monaco.editor // Other monaco ed1.create(…) ed2.create(…)

2reactions
14glwucommented, Jul 28, 2022

the same problem, how to solve?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Changing theme in one editor should change all editors #338
It is currently not possible to have two editors have different themes. 58
Read more >
Monaco Editor different themes on multiple ... - Stack Overflow
I tried monaco.editor.setTheme('vs') in the console and it changed all the editor themes. I tried to set different themes in the configuration, ...
Read more >
WordPress Full Site Editor Tutorial: How to Customize Twenty ...
In this tutorial, we'll use the WordPress Twenty Twenty- Two theme which is the first with full site editing built in!
Read more >
Link to plugin editor missing when using Twenty Twenty Two ...
I have one install with zero plugins. With Twenty Twenty Two theme there is no plugin editor, however if I switch to Twenty...
Read more >
10 Common WordPress Theme Issues & How To Fix Them
If your theme doesn't require any page template for the homepage layout make sure this option is set to”Your latest posts.” If your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found