简体   繁体   English

如何为 vs code 创建自己的主题?

[英]How can I create my own theme for vs code?

How can I create my own theme for vs code?如何为 vs code 创建自己的主题? change color & syntax colors?更改颜色和语法 colors?

Once you have tweaked your theme colors using workbench.colorCustomizations and editor.tokenColorCustomizations , it's time to create the actual theme.使用workbench.colorCustomizationseditor.tokenColorCustomizations调整主题 colors 后,就该创建实际的主题了。

  1. Generate a theme file using the Developer: Generate Color Theme from Current Settings command from the Command Palette使用开发人员生成主题文件:命令面板中的从当前设置生成颜色主题命令

  2. Use VS Code's Yeoman extension generator to generate a new theme extension:使用 VS Code 的Yeoman扩展生成器生成新的主题扩展:

    bash npm install -g yo generator-code yo code

  3. If you customized a theme as described above, select 'Start fresh'.如果您如上所述自定义主题,select 'Start fresh'。

  4. Copy the theme file generated from your settings to the new extension.将从您的设置生成的主题文件复制到新的扩展。

You can also use an existing TextMate theme by telling the extension generator to import a TextMate theme file (.tmTheme) and package it for use in VS Code.您还可以通过告诉扩展生成器导入 TextMate 主题文件 (.tmTheme) 和 package 来使用现有的 TextMate 主题,以便在 VS Code 中使用。 Alternatively, if you have already downloaded the theme, replace the tokenColors section with a link to the .tmTheme file to use.或者,如果您已经下载了主题,请将tokenColors部分替换为要使用的.tmTheme文件的链接。

 { "type": "dark", "colors": { "editor.background": "#1e1e1e", "editor.foreground": "#d4d4d4", "editorIndentGuide.background": "#404040", "editorRuler.foreground": "#333333", "activityBarBadge.background": "#007acc", "sideBarTitle.foreground": "#bbbbbb" }, "tokenColors": "./Diner.tmTheme" }

Tip: Give your color definition file the -color-theme.json suffix and you will get hovers, code completion, color decorators, and color pickers when editing.提示:给您的颜色定义文件-color-theme.json后缀,您将在编辑时获得悬停、代码完成、颜色装饰器和颜色选择器。

Source: Create a new Color Theme来源: 创建一个新的颜色主题

You can create your own theme or customize a specific theme to your preferred style by following the official documentation from VS Code VS Code Theme Doc您可以按照 VS Code VS Code Theme Doc的官方文档创建自己的主题或自定义特定主题为您喜欢的样式

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM