microsoft / microsoft/monaco-editor
Reopen "Background color does not seems to be working on monaco.editor.defineTheme rules section."
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!');
// this comment should have a background
}`;
const mytheme = {
base: 'vs',
rules: [
{ token: 'comment', foreground: "ff0000", background: "ff00ff" },
],
inherit: false,
colors: {},
}
monaco.editor.defineTheme("myTheme", mytheme)
// Hover on each property to see its docs!
const myEditor = monaco.editor.create(document.getElementById("container"), {
value,
language: "javascript",
automaticLayout: true,
theme: "myTheme",
});
Reproduction Steps
Background color does not seems to be working on monaco.editor.defineTheme rules array section. I am being able to set the foreground color and fontStyle, but for some reason the background color does not work. Any insight would be greatly appreciated.
Actual (Problematic) Behavior
No response
Expected Behavior
No response
Additional Context
This issue is a reopening of the following issue, that was closed without solution:
https://github.com/microsoft/monaco-editor/issues/586
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 the defineTheme rules using the comment token's foreground and background colors. Reproduce the behavior, then trace how theme token backgrounds are handled; done means the configured comment background renders while foreground and fontStyle continue to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100