如何自定义Atom One Dark主题附带的评论样式?

时间:2016-05-29 07:28:41

标签: atom-editor

我是Atom的新手,我想知道我们是否可以通过style.less (Atom > Stylesheet...)文件自定义One Dark Syntax Theme附带的评论样式。我查找了主题的源代码,并在language.less文件中找到了这个:

.comment {
color: @mono-3;
font-style: italic;

.markup.link {
color: @mono-3;
  }
}

具体来说,我想更改为font-stylenormal,但我似乎无法找到方法,请帮忙。谢谢。

3 个答案:

答案 0 :(得分:8)

您不应再使用atom-text-editor::shadow

enter image description here

您现在应该使用

atom-text-editor.editor .syntax--comment {
  font-style: normal;
}

答案 1 :(得分:3)

[更新]

Atom已经改变,接受的答案现在是你应该使用的答案!

[旧答案]

您尝试定位的元素位于文本编辑器元素的shadow DOM中;尝试

atom-text-editor::shadow .comment {
  font-style: normal;
}

答案 2 :(得分:0)

具体来说,您可能希望将示例更改为

.editor, atom-text-editor::shadow {
  .comment {
    font-style: normal;
  }
}