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

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

Closed
JulCesWhat opened this issue Sep 16, 2017 · 17 comments
Labels
editor-core feature-request Request for new features or functionality
Milestone

Comments

@JulCesWhat
Copy link

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

@CedricDumont
Copy link

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

@erenbaydemir
Copy link

Neither 'rules' nor colors definition works for me. Had to change color using CSS.

@alexdima alexdima added the feature-request Request for new features or functionality label Nov 13, 2017
@yaananth
Copy link
Member

+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

@ghardin137

This comment has been minimized.

@perkrlsn

This comment has been minimized.

@gmilano

This comment has been minimized.

@mrQ000

This comment has been minimized.

@pcktm

This comment has been minimized.

@cnayan

This comment has been minimized.

@bandaloo
Copy link

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?

@n-dragon
Copy link

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 ?

@thien-do
Copy link
Contributor

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)

@thien-do
Copy link
Contributor

Btw can someone point me the direction to fix this? I'd be happy to have a PR :D

@Anu3ev
Copy link

Anu3ev commented Aug 19, 2022

+1

@terpimost
Copy link

is it supposed to work at all or it was some mistake to expose it?

@Eve-Sama
Copy link

Still not working

@hediet
Copy link
Member

hediet commented Feb 24, 2023

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!

@hediet hediet closed this as not planned Won't fix, can't repro, duplicate, stale Feb 24, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Apr 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
editor-core feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests