【问题标题】:How do I set custom HTML tag highlighting in a Sublime Text 3 theme?如何在 Sublime Text 3 主题中设置自定义 HTML 标签突出显示?
【发布时间】:2014-03-06 10:23:55
【问题描述】:

我修改了现有的ST3主题文件,让id标签属性以特定的颜色格式高亮显示,效果很好:

<dict>
  <key>name</key>
  <string>CSS: #id</string>
  <key>scope</key>
  <string>entity.other.attribute-name.id.html</string>
  <key>settings</key>
  <dict>
    <key>fontStyle</key>
    <string></string>
    <key>foreground</key>
    <string>#99ff00</string>
    <key>background</key>
    <string>#0066ff</string>
  </dict>
</dict>

问题是我还想对"class""style""name" 属性进行特定的突出显示(理想情况下,每个属性都有不同的颜色)。但只需更改entity.other.attribute-name 字符串,not 会突出显示标签内的特定文本。我的标签属性已经默认设置为绿色,这也可以:

<dict>
  <key>name</key>
  <string>Tag attribute</string>
  <key>scope</key>
  <string>entity.other.attribute-name</string>
  <key>settings</key>
  <dict>
    <key>fontStyle</key>
    <string></string>
    <key>foreground</key>
    <string>#A6E22E</string>
  </dict>
</dict>

如何更改“id”以外的标签属性?我希望"class""style""name"attributes 也像“id”一样有一个后突出显示,但到目前为止,无论我尝试什么,都只有“id”被突出显示。我需要改变什么?谢谢!

【问题讨论】:

标签: html themes sublimetext sublimetext3 color-scheme


【解决方案1】:

您可以使用entity.other.attribute-name.html 定位他们

【讨论】:

    猜你喜欢
    • 2014-01-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-02-11
    • 1970-01-01
    • 2014-05-18
    • 1970-01-01
    相关资源
    最近更新 更多