看起来 vscode 侧边栏有两种颜色:浅色和深色。我想要使用 solarized 浅色主题,但是想要一个深色的侧边栏。有没有方法可以实现这个效果?
看起来 vscode 侧边栏有两种颜色:浅色和深色。我想要使用 solarized 浅色主题,但是想要一个深色的侧边栏。有没有方法可以实现这个效果?
现在VS Code支持工作台主题,查看此链接
这意味着,在设置中我们可以按照以下方式自定义颜色:
"workbench.colorCustomizations": {
"sideBar.background": "#111111"
}
在 .vscode 文件夹中创建名为 settings.json 的文件,并输入以下内容:
您可以根据附图所示更改侧边栏、注释、背景颜色甚至更多的图标颜色。
{
"workbench.colorCustomizations": {
"activityBar.background": "#6ff304",
"titleBar.activeBackground": "#69e024",
"titleBar.activeForeground": "#5809ce",
"icon.foreground": "#91ff00",
"symbolIcon.colorForeground": "#ff0000",
"icon.colorForeground": "#ff0000",
"activityBar.inactiveForeground": "#524747"
},
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": [
"comment",
"comment.block.documentation",
"comment.block.documentation.js",
"comment.line.double-slash.js",
"storage.type.class.jsdoc",
"entity.name.type.instance.jsdoc",
"variable.other.jsdoc",
"punctuation.definition.comment",
"punctuation.definition.comment.begin.documentation",
"punctuation.definition.comment.end.documentation"
],
"settings": {
"fontStyle": "italic",
"foreground": "#78108a"
}
}
]
}
}
.vscode
文件夹中创建名为settings.json
的文件,并输入以下内容:{
"workbench.colorTheme": "Default Light+",
"workbench.colorCustomizations": {
"activityBar.background": "#e7e7e7",
"activityBar.foreground": "#000000"
}
}
颜色值#e7e7e7
(用于活动栏背景)使其与其他部分区分开来,因此它更加突出。
对于全局设置,请在全局settings.json
文件中添加以下行。
我的全局settings.json
如下所示:
{
"workbench.editorAssociations": {
"*.ipynb": "jupyter.notebook.ipynb"
},
"python.pipenvPath": "C:\\Users\\abhi\\anaconda3\\envs",
"workbench.colorTheme": "Default Light+",
"workbench.colorCustomizations": {
"activityBar.background": "#e7e7e7",
"activityBar.foreground": "#000000"
},
"files.autoSave": "afterDelay",
"git.confirmSync": false,
"terminal.integrated.defaultProfile.windows": "Command Prompt"
}
settings.json
文件可在以下位置找到:Windows: %APPDATA%\Code\User\settings.json
mac: $HOME/Library/Application Support/Code/User/settings.json
Linux: $HOME/.config/Code/User/settings.json
现在Visual Studio Code的外观如下所示:
settings.json
文件中。{
"workbench.colorTheme": "Default Light+",
"workbench.colorCustomizations": {
"activityBar.background": "#f4f4f4",
"activityBar.foreground": "#000000"
}
}
结果:
如果您的操作系统具有自动/手动切换暗/亮色主题功能,并且想要仅自定义特定主题,请使用以下语法:
{
"window.autoDetectColorScheme": true,
"workbench.colorTheme": "Default Light+",
"workbench.colorCustomizations": {
"[Default Light+]": {
"activityBar.background": "#f3f3f3",
"activityBar.foreground": "#333333"
},
"[Default Dark+]": {
"activityBar.background": "#333333",
"activityBar.foreground": "#f3f3f3"
}
}
}