microsoft / microsoft/monaco-editor
[Bug] When multiple Monaco editors exist simultaneously, the theme of each editor is forced to be unified
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 46.8k
- Forks
- 4.1k
- Avg merge
- 17h 58m
- Merged PRs (30d)
- 1
Description
Reproducible in vscode.dev or in VS Code Desktop?
- Not reproducible in vscode.dev or VS Code Desktop
Reproducible in the monaco editor playground?
- Not reproducible in the monaco editor playground
Monaco Editor Playground Link
Monaco Editor Playground Code
const value = /* set from `myEditor.getModel()`: */ `function hello() {
alert('Hello world!');
}`;
// Hover on each property to see its docs!
const myEditor = monaco.editor.create(document.getElementById("container"), {
value,
theme: 'vs',
language: "javascript",
automaticLayout: true,
});
const value2 = /* set from `myEditor.getModel()`: */ `function hello() {
alert('Hello world!');
}`;
// Hover on each property to see its docs!
const myEditor2 = monaco.editor.create(document.getElementById("container2"), {
value,
language: "javascript",
theme: 'vs-dark',
automaticLayout: true,
});
Reproduction Steps
1、Create an editor and set the theme to 'vs'
2、Create a second editor with the theme 'vs-dark'
Actual (Problematic) Behavior
The themes of the two Monaco editors are the same
Expected Behavior
Each Monaco editor should apply its own theme
Additional Context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked Monaco Editor Playground reproduction and inspect how the two editor instances apply the theme options 'vs' and 'vs-dark'. Confirm the shared-theme behavior, then verify that each editor can retain its configured theme without affecting the other and rerun the two-editor reproduction to confirm the result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100