You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my case for the Razor language to set the token background color to yellow to be similar to the big brother Visual Studio, by setting the background property for the matching token metatag.cs
The object has a property called 'background' but looking at the source code here it does not use that value and only CSS color property is set.
// !!! Tokens can be inspected using F1 > Developer: Inspect Tokens !!!monaco.editor.defineTheme('myCustomTheme',{base: 'vs',// can also be vs-dark or hc-blackinherit: true,// can also be false to completely replace the builtin rulesrules: [{token: 'metatag.cs',foreground: '000000',background: 'FFFF33',fontStyle: 'bold'},{token: 'comment',foreground: 'ffa500',fontStyle: 'italic underline'},{token: 'comment.js',foreground: '008800',fontStyle: 'bold'},{token: 'comment.css',foreground: '0000ff'}// will inherit fontStyle from `comment` above]});monaco.editor.create(document.getElementById("container"),{value: getCode(),language: "razor",theme: "myCustomTheme"});functiongetCode(){return"<html><!-- // !!! Tokens can be inspected using F1 > Developer: Inspect Tokens !!! -->\n<head>\n <!-- HTML comment -->\n <style type=\"text/css\">\n /* CSS comment */\n </style>\n <script type=\"javascript\">\n // JavaScript comment\n </"+"script>\n</head>\n<body></body>\n</html>";}
The text was updated successfully, but these errors were encountered:
If the plan is to not support changing the background color at all, then can I suggest that the background property on ITokenThemeRule is marked as obsolete/deprecated if it does not do anything
@warrenbuckley Thank you for your input. Both issues are marked with the label feature-request. That means that the feature has not been implemented yet and might be implemented in the future.
Hello 👋
I am using Monaco editor engine and I am trying to set/colorize the background of a token based on the example in the playground.
https://microsoft.github.io/monaco-editor/playground.html#customizing-the-appearence-tokens-and-colors
In my case for the Razor language to set the token background color to yellow to be similar to the big brother Visual Studio, by setting the background property for the matching token
metatag.cs
The object has a property called 'background' but looking at the source code here it does not use that value and only CSS color property is set.
vscode/src/vs/editor/common/modes/supports/tokenization.ts
Line 402 in 0135019
Example
The text was updated successfully, but these errors were encountered: