如何在 Visual Studio Code 中自定义 HTML 属性的颜色?

问题描述

如何在 Visual Studio Code 中自定义诸如 class=""、href=""、src=""、style="" 等 HTML 属性的颜色?

解决方法

打开 settings.json 文件并添加:

"editor.tokenColorCustomizations": {
    "textMateRules": [
        {
            "scope":"entity.other.attribute-name","settings": {
                "foreground": "#ca9829","fontStyle": "italic"
            }
        }
    ]
}

您也可以将主题设置为仅适用于该主题,而不适用于全局。 Here 是这一切的诀窍。

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...