Skip to content
Tutorials Center
My learning

Topics

Lesson 10 of 40 ยท Interface and Settings

Themes, Fonts and Icons

Make VS Code comfortable to read: pick color and icon themes, set fonts and ligatures, adjust zoom, customize colors with workbench.colorCustomizations and check contrast.

You will look at your editor for hours, so the way it looks matters. VS Code separates appearance into independent choices: the color theme (colors of the editor and interface), the file icon theme, the product icon theme, the font and the zoom. Each can be changed without affecting the others.

Color themes

Open the picker with Ctrl+K Ctrl+T or Preferences: Color Theme from the Command Palette. Move up and down the list and the editor previews each theme live. Press Enter to keep one, Esc to cancel. Built-in themes include:

  • Dark Modern, Light Modern (the defaults)
  • Dark+ / Light+ (older defaults)
  • Monokai, Solarized Dark / Light, Quiet Light, Abyss, Kimbie Dark
  • High Contrast and High Contrast Light for accessibility

The setting is "workbench.colorTheme": "Default Dark Modern". You can install more from the Extensions view: search theme and sort by installs. Popular choices include One Dark Pro, Dracula, GitHub Theme, Night Owl and Catppuccin.

Follow the operating system

If your computer switches between light and dark by time of day, let VS Code follow:

JSON
{
  "window.autoDetectColorScheme": true,
  "workbench.preferredDarkColorTheme": "Default Dark Modern",
  "workbench.preferredLightColorTheme": "Default Light Modern"
}

Choosing a good theme

  1. Prefer a theme with enough contrast between text and background; pure gray on gray tires the eyes.
  2. Test it on your language: some themes color Python well and HTML poorly.
  3. Change the theme if you work in a bright room or at night. Many people keep a dark theme for evenings and a light one for daytime.
  4. If you have trouble reading, try the High Contrast themes, which also draw borders around elements.

File icon themes and product icons

Preferences: File Icon Theme controls the little icons in the Explorer and tabs. Seti (default) uses colored symbols; Minimal hides them; the extension Material Icon Theme is a popular replacement with distinct icons for hundreds of file and folder names. Preferences: Product Icon Theme changes the interface icons (Activity Bar, buttons) and is rarely needed.

Fonts

A programming font is monospaced so that every character has the same width, which aligns code. Set the family and size in settings:

JSON
{
  "editor.fontFamily": "'JetBrains Mono', 'Cascadia Code', Consolas, monospace",
  "editor.fontSize": 15,
  "editor.lineHeight": 1.6,
  "editor.fontLigatures": true,
  "editor.fontWeight": "400",
  "terminal.integrated.fontSize": 14
}
  • List several fonts separated by commas. VS Code uses the first one installed on your machine and falls back to the next. End with a generic monospace.
  • The font must be installed on your computer (not in VS Code). Install it, then restart VS Code.
  • Ligatures merge sequences such as =>, !== or <= into single shapes. Fonts like Fira Code, JetBrains Mono and Cascadia Code support them. Some people love them, others find them confusing; they are optional.
  • editor.lineHeight accepts a multiplier (below 8) or pixels (8 and above).
  • Setting "editor.fontLigatures": "'calt', 'ss01'" enables specific OpenType features.

The editor font and the terminal font are separate settings (terminal.integrated.fontFamily, terminal.integrated.fontSize).

Zoom and the interface size

  • Ctrl+= and Ctrl+- zoom the whole window, including the Side Bar and menus; Ctrl+0 resets. The setting is window.zoomLevel.
  • To change only the editor text, use editor.fontSize, or hold Ctrl while scrolling if you turn on editor.mouseWheelZoom.
  • For screen sharing, zoom in a few steps so the audience can read your code.

Customizing individual colors

You can override any theme color without writing a theme. Use workbench.colorCustomizations for interface colors and editor.tokenColorCustomizations for syntax colors:

JSON
{
  "workbench.colorCustomizations": {
    "editor.background": "#1a1b26",
    "statusBar.background": "#7e3ff2",
    "editorCursor.foreground": "#ffcc00"
  },
  "editor.tokenColorCustomizations": {
    "comments": "#6a9955",
    "textMateRules": [
      { "scope": "keyword.control", "settings": { "fontStyle": "italic bold" } }
    ]
  }
}

The list of color keys is in Preferences: Open Default Settings's theme-color reference and in the Developer command Developer: Inspect Editor Tokens and Scopes, which shows the scope of the token under the cursor. A neat trick: set a different statusBar.background or titleBar.activeBackground in each project's .vscode/settings.json, so you can tell windows apart at a glance.

A stand-in: checking contrast

Good readability depends on contrast between the text color and the background. This JavaScript stand-in implements the WCAG contrast ratio formula, so you can test color pairs from a theme. It is a calculator, not VS Code code.

JS Stand-in: contrast ratio calculator

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Aim for at least 4.5:1 for normal text. The "Too faint" pair fails clearly, which is why some low-contrast themes look pretty but are tiring to read.

Where themes come from

Themes are normal extensions with a themes contribution point. You can see how a theme colors a token by running Developer: Inspect Editor Tokens and Scopes. If you ever want to create a theme, the Yeoman generator (yo code) has a "New Color Theme" template. This lesson stays on using them; extension authoring is outside this course.

Settings Sync for appearance

Sign in and turn on Settings Sync (Accounts icon, then Turn on Settings Sync) to carry your theme, font and extensions to another computer. Profiles (User, Workspace and Folder Settings) can hold a different look for each kind of work.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which shortcut opens the color theme picker?

    Ctrl+K Ctrl+T opens Preferences: Color Theme, which previews themes live.
  2. 2. Why list several fonts in editor.fontFamily?

    The font list works as a fallback chain, ending with a generic monospace.
  3. 3. What are font ligatures?

    Ligatures merge character sequences like => or !== into single glyphs in supporting fonts.
  4. 4. Which setting overrides individual interface colors?

    workbench.colorCustomizations lets you override named theme colors.

Summary

  • Color, file icon and product icon themes are independent choices.
  • Ctrl+K Ctrl+T previews color themes live; window.autoDetectColorScheme follows the OS.
  • Set editor.fontFamily as a fallback list; fonts must be installed on your system.
  • Zoom with Ctrl+= and Ctrl+-; customize single colors in workbench.colorCustomizations.
  • Check contrast: about 4.5:1 or higher for comfortable text.

Next: Multi-Cursor Editing