【问题标题】:How to make comments in color?如何进行彩色评论?
【发布时间】:2020-02-24 05:18:21
【问题描述】:

我正在尝试让我的 cmets 有颜色。我在样式中输入的内容较少,但此评论仅适用于 /* */ 我希望它也能正常工作,或者改为通过 //

atom-text-editor
.syntax--comment {
color: red;
}

我得到以下信息:

编译 Less 样式表时出错:

【问题讨论】:

标签: coffeescript atom-editor


【解决方案1】:

Atom 基于 Chromium,这就是为什么它包含完整的开发人员工具,正如您在 Chrome 浏览器中所知道的那样。检查器将允许您找到任何元素的选择器。

要区分block cmets和line cmets,需要使用不同的选择器:

atom-text-editor {
  .syntax--comment.syntax--line {
    color: blue
  }

  .syntax--comment.syntax--block {
    color: red
  }
}

或者,如果您想非常严格,请使用选择器.syntax--comment.syntax--line.syntax--double-slash

【讨论】:

    猜你喜欢
    • 2020-07-08
    • 2017-07-09
    • 1970-01-01
    • 2012-12-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-09-22
    相关资源
    最近更新 更多