monaco-editor
monaco-editor copied to clipboard
Background color does not seems to be working on monaco.editor.defineTheme rules section.
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.
monaco-editor version: 0.10.0 Browser: Chrome OS: Windows
same for me, just added some code
monaco.editor.defineTheme('myCoolTheme', {
base: 'vs-dark',
inherit: false,
rules: [
{ token: 'green', background: 'FF0000', foreground: '00FF00', fontStyle: 'italic'},
{ token: 'red', foreground: 'FF0000' , fontStyle: 'bold underline'},
{ background: '000000' },
{ foreground: 'FFFFFF' }
],
colors: {
'editor.foreground': '#FFFFFF',
'editor.background': '#000000',
}
});
at line : { token: 'green', background: 'FF0000', foreground: '00FF00', fontStyle: 'italic'}, the rule that implies the "green" displays the background in black and not in green : FF0000
Neither 'rules' nor colors definition works for me. Had to change color using CSS.
+1
Also, can we not add the token
name as css class? We seem to generate classs names as mtk{number}
, depending on that is fragile as we change themes and rules
This appears to be still non-functional. Just bumping for notice
And another bump, would love to see this bug fixed.
Is there some alternative to workaround this bug ?
another bump
bump, still not working
Not working
i would love to see a solution to this. for my use case, i am making the background of the editor transparent since i am displaying the code on top of video. because the video changes colors all the time i need to make the background of the text a solid color. since background
of ITokenThemeRule
is broken i have to use css to change background-color
of the automatically generated mtk
css class, which of course is very fragile. i'd like to fix it even just for my own purposes; can anyone point me to where these css classes are generated?
Neither 'rules' nor colors definition works for me. Had to change color using CSS.
how did you add css ? do you rely on mtk class numbers ?
I don't think relying on mtk class is safe. It seems to be somewhat auto generated based on our config. (e.g. changing the foreground color results in another class)
Btw can someone point me the direction to fix this? I'd be happy to have a PR :D
+1
is it supposed to work at all or it was some mistake to expose it?
Still not working
Closing due to missing reproducible example.
If this bug still applies, please create a new issue. Make sure to select the form for bugs and include a minimal reproducible example. Thanks!