Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 of 2 tasks
Fabioni opened this issue Apr 5, 2024 · 2 comments

Comments

@Fabioni
Copy link

Fabioni commented Apr 5, 2024

Reproducible in vscode.dev or in VS Code Desktop?

  • 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:
#586

@Fabioni
Copy link
Author

Fabioni commented Apr 5, 2024

linking #4405

@Fabioni
Copy link
Author

Fabioni commented Apr 5, 2024

linking #207

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant