DEV Community

Cover image for Improve Your Visual Studio Code's Look with Custom Fonts
Kunal Tanwar
Kunal Tanwar

Posted on • Updated on

Improve Your Visual Studio Code's Look with Custom Fonts

Are you tired of the default Windows OS font, Segoe UI, making your Visual Studio Code look not-so-great? Take a look at the transformation below:

VS Code Screenshot

Today, I'm going to show you a simple way to switch up your VS Code's user interface (UI) font. You can select any font you like and install all its weights, as we're not entirely sure which one VS Code uses. I've personally gone with Inter.

Here's how to do it:

  1. First, locate the workbench.desktop.main.css file. You can usually find it in your Microsoft VS Code installation directory. On my machine, it's here:
    C:\Users\<Your User Name>\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench.

  2. Open the workbench.desktop.main.css file, ensuring that your code formatter is disabled if you're editing in VS Code.

  3. Look for this piece of code:

.windows {
    font-family: Segoe WPC, Segoe UI, sans-serif;
}
Enter fullscreen mode Exit fullscreen mode
  1. Modify it with your custom font. You can also add a couple of optional properties for improved readability:
.windows {
    font-family: Inter, Segoe WPC, Segoe UI, sans-serif;
    /* works only in Windows and Linux */
    text-rendering: optimizeLegibility;
    /* works only in Mac OS */
    -webkit-font-smoothing: antialiased;
}
Enter fullscreen mode Exit fullscreen mode
  1. Save your file, restart VS Code, and witness the changes!

Your VS Code will now have a fresh new look:

VS Code Screenshot with Custom Font

VS Code 2nd Screenshot with Custom Font

But here's a small caveat: you'll see a [Unsupported] warning every time you open your code editor:

Warning Screenshot

You can disable this warning by clicking on the little cog icon and selecting Don't Show Again:

Warning Screenshot

Wait There's More

Unfortunately, the above method won't work for the Context Menu, Search Bar, and Markdown previews (mainly iframes) because their styling is generated by JavaScript, and configuring those can be quite complicated.

For these elements, you'll need to customize the workbench.desktop.main.js file, which you can find in the same location.

Context Menu:

Search for :host-context(.windows)

Piece of Code

Context Menu

Search Bar:

Search for DEFAULT_FONT_FAMILY

Piece of Code

For Markdown, you'll need to customize a third file. Yes, it's a bit of work, but it's worth it!

Markdown Preview:

The file to modify is markdown.css, located inside: C:\Users\<Your User Name>\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\markdown-language-features\media. Replace the default code with this updated one:

html, body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", system-ui, "Ubuntu", "Droid Sans", sans-serif;
}
Enter fullscreen mode Exit fullscreen mode

Markdown Preview

Now, for the not-so-great news - you'll need to repeat this process after each VS Code update (which can be frequent). I had plans to create an extension to simplify this process, though I couldn't due to college commitments.

And with that, it's time to bid you goodbye:

GOODBYE

Latest comments (1)

Collapse
 
pookybeer profile image
PookyBeer

Thank you! This is awesome!