monaco-editor icon indicating copy to clipboard operation
monaco-editor copied to clipboard

Reopen "Background color does not seems to be working on monaco.editor.defineTheme rules section."

Open Fabioni opened this issue 1 year ago • 8 comments

Reproducible in vscode.dev or in VS Code Desktop?

  • [X] Not reproducible in vscode.dev or VS Code Desktop

Reproducible in the monaco editor playground?

Monaco Editor Playground Link

https://microsoft.github.io/monaco-editor/playground.html?source=v0.47.0#XQAAAAJyAgAAAAAAAABBqQkHQ5NjdMjwa-jY7SIQ9S7DNlzs5W-mwj0fe1ZCDRFc9ws9XQE0SJE1jc2VKxhaLFIw9vEWSxW3yscw14OcO_1uhs0-3YGTBOsVJ4S4FwfCDQb5-2uUHXTVAefbVSd9IzaZ_vv9VR9KugsKimARHSWlrTPOQHROITHxmAetfeRrm3VHdSe7_Etv6WpgzlHEUT3FrRpJfU0nW28tDtD5OgHyVk3rnhWlhuIaNhLo010ZK-WajoxXyf8yld6yB_zV61-qrJJVvX2fOZZoh_-3dcSQHKIXTuZgxdHu8cns1UZ0GMNHQA-O2TFz4_SMRIVm30405EwLqyMZpjvQXGx7egWwlX_HGHT1Y4NU5BLFtcHYDGPWCIpXFTQav22jRH50VfvJkO0X9Pz_ogXrRq3doHhh4i_vuhdErrQ4gMSS2Hu-vtmRpHDjLUKv2h-gIwifxcdA8Zld6wbgPQtfE5a8ql7gJW6mkCZoONZVBc8ji9DG6_8GAfKNa-HnvXcQZdYTQ7Vgyxe5cdI-YPPUJZNkSqkAUvJeXike5yebu8SZtmYKlFNIoLNihdfAJ_hKmaY4TZkof__3MUYf

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

Fabioni avatar Apr 05 '24 20:04 Fabioni

linking https://github.com/microsoft/monaco-editor/issues/4405

Fabioni avatar Apr 05 '24 20:04 Fabioni

linking https://github.com/microsoft/monaco-editor/issues/207

Fabioni avatar Apr 05 '24 20:04 Fabioni

We have the same issue: the background property is in the API for theme rules, but doesn't work.

yuliacech avatar May 22 '24 12:05 yuliacech