Monaco-editor: Background color does not seems to be working on monaco.editor.defineTheme rules section.

Created on 17 Sep 2017  路  9Comments  路  Source: microsoft/monaco-editor

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

editor-core feature-request

Most helpful comment

This appears to be still non-functional. Just bumping for notice

All 9 comments

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

Was this page helpful?
0 / 5 - 0 ratings