Answer a question

I am using Nord theme in VScode. The block quotes in the markdown files look like this which is very illegible. How to change the text background?

enter image description here

I have tried the followings in User Settings but it not working:

"workbench.colorCustomizations": {
    "textBlockQuote.background": "#ff0000", // changes the markdown preview
    "editor.textBlockQuote.background": "#0000ff", // Property not allowed
    "[Nord]": {
        "textBlockQuote.background": "#ff0000", // changes the markdown preview
    },
},
"editor.tokenColorCustomizations": {
    "textBlockQuote.background": "#ff0000", // Property not allowed
    "editor.textBlockQuote.background": "#ff0000", // Property not allowed
    "[Nord]": {
        "textBlockQuote.background": "#ff0000", // Property not allowed 
        "editor.textBlockQuote.background": "#ff0000", // Property not allowed
    }
},

Answers

The editor colorization comes from a textmate grammar. To override this, you need to use the textMateRules section of editor.tokenColorCustomizations

"editor.tokenColorCustomizations": {
    "[Nord]": {
        "textMateRules": [
            {
                "scope": "markup.quote.markdown",
                "settings": {
                    "foreground": "#f0f"
                }
            }
        ]
    }
}

The scope used here (markup.quote.markdown) is the textmate scope of markdown block quotes. You can use the Developer: Inspect TM Scopes command in VS Code to determine the target scope

Note that VS Code does not support setting the background color of text. This is tracked here

Logo

开发云社区提供前沿行业资讯和优质的学习知识,同时提供优质稳定、价格优惠的云主机、数据库、网络、云储存等云服务产品

更多推荐