Skip to content

Commit 5512564

Browse files
committed
优化 自定义编辑器代码颜色文档
1 parent e7eb4d1 commit 5512564

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

Tutorial/themes.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
在文件`setting.json`的源码视图中,通过定义`"editor.tokenColorCustomizations"`字段来自定义您喜欢的主题颜色。[可自定义代码颜色的相关参数](/Tutorial/Other/themes_param#文本编辑区)
4545

4646
```json
47-
"editor.tokenColorCustomizations": {//仅对新着色生效
47+
"editor.tokenColorCustomizations": {
4848
"[Default]": {//绿柔
4949
"rules":[
5050
{
@@ -53,13 +53,6 @@
5353
"fontStyle": "italic",
5454
"foreground": "#248C85"
5555
}
56-
},
57-
{
58-
"scope": "punctuation.definition.comment",
59-
"settings": {
60-
"fontStyle": "italic",
61-
"foreground": "#248C85"
62-
}
6356
}
6457
]
6558
},
@@ -76,10 +69,21 @@
7669
}
7770
```
7871

72+
**目前可以采用以下步骤简便的自定义代码颜色:**
73+
74+
1.`settings.json`源码视图中加入`"editor.tokenColorCustomizations"`设置(**必须执行该步骤才能看到后面步骤的菜单项**
75+
2. 将光标放到要改颜色的代码位置,选择菜单`工具`-`主题`-`Inspect Tokens And Colors`查看当前代码着色信息
76+
3. 将上一步控制台输出的`Token Color Rule`内容拷贝到`settings.json``"editor.tokenColorCustomizations"`对应位置(**注意:要放到对应的主题下**
77+
4. 保存`settings.json`文件后即可看到修改后的效果
78+
79+
**完整的操作动画如下图**
80+
81+
<img src="/static/snapshots/tutorial/custom_token_color.gif" style="border: 1px solid #eee;border-radius: 5px; " />
82+
7983
注意:
8084

8185
* 目前只能在现有的3个主题Default柔和、Monokai酷黑、Atom One Dark雅蓝的基础之上复写,不能完全更新新主题。
82-
* 自定义编辑器代码颜色,目前只对`JavaScript(ES6+)``HTML(ES6+)``Vue``CSS``Less``SCSS``Stylus``Typescript``Markdown`语言生效。
86+
* 自定义编辑器代码颜色,目前只对`JavaScript(ES6+)``HTML(ES6+)``Vue``CSS``Less``SCSS``Stylus``Typescript``Markdown``JSON`语言生效。
8387

8488

8589
## 文件图标
1.13 MB
Loading

0 commit comments

Comments
 (0)