【问题标题】:How do I make all HTML attributes italicized in VSCode? Is it possible?如何在 VSCode 中将所有 HTML 属性设置为斜体?是否可以?
【发布时间】:2019-10-15 05:00:50
【问题描述】:

感谢您的帮助。如何使所有 HTML 属性(即单词 type=)在 VSCode 中斜体?是否可以?我的意思是想换个主题。您知道某些主题如何具有斜体属性吗? type=, class=, id=, 我只是想让这些家伙在主题中用斜体显示。

【问题讨论】:

    标签: html attributes


    【解决方案1】:

    VS Code 的syntax color themes 可以指定fontStyle 除了语法范围的颜色。要使文本斜体,您需要设置"fontStyle": "italic"

    这个例子editor.tokenColorCustomizations setting使用fontStyle使一些html属性斜体:

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

    这是example of how to set fontStyle in an actual color theme

    entity.other.attribute-name 只是一个示例范围。您可能需要根据您的特定需求调整范围或设置多个范围的样式

    【讨论】:

      【解决方案2】:

      你可以使用标签<i>inert italicized content here</i>例子:

      `<!DOCTYPE html>
       <html lang="en">
        <head>
          <meta charset="UTF-8" />
          <meta name="viewport" content="width=device-width, initial-scale=1.0" />
          <meta http-equiv="X-UA-Compatible" content="ie=edge" />
          <title>Document</title>
        </head>
        <body>
          <i>this stuff is italicized</i>
        </body>
      </html>`
      

      另一个很好的标签是&lt;em&gt;&lt;/em&gt;,用来强调标签。 Here's a great website I like to use.

      编辑:here

      【讨论】:

      • 我想换个主题。您知道某些主题如何具有斜体属性吗? type=, class=, id=, 我只是想让这些家伙在主题中用斜体显示。
      • 说实话,我从未见过任何“主题”属性、类或 ID。我有点困惑......不要对他投反对票。他是新来的。
      • marketplace.visualstudio.com/… 看看这个主题是如何将关键词斜体化的?我希望属性为我的主题斜体。我想编辑它。有可能吗?
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-01-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-08-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多