DEV Community

Alex Saveau
Alex Saveau

Posted on • Originally published at alexsaveau.dev on

5

Customize GitHub’s code font

It occurred to me yesterday that I’ve spent way too much time nitpicking over my IDE’s font, but then come time for code reviews… not a ligature in sight. Here’s a quick guide to change that.

Prerequisites

Install Refined GitHub. It’s probably a sin at this point to not use that extension. 😉

Change your font

In Refined GitHub’s settings (chrome://extensions/?options=hlepfoohegkhhmjieoechaddaejaokhf), paste in this custom CSS:



/*
The wght@450 part is the font weight.
If you want less or more boldness, decrease or increase this number.
*/
@import url("https://fonts.googleapis.com/css2?family=Fira+Code:wght@450&display=swap");

pre, code, .blob-code, .blob-code-marker {
  font-family: 'Fira Code', monospace !important;
}


Enter fullscreen mode Exit fullscreen mode

I personally love Fira Code, but you can change this to whatever you want as long as the font is hosted somewhere.

Before After
Default GitHub font Custom GitHub code font

That’s it! Enjoy.

Jetbrains image

Don’t Become a Data Breach Headline

57% of organizations have suffered from a security incident related to DevOps toolchain exposures. Is your CI/CD protected? Check out these nine practical tips to keep your CI/CD secure—without adding friction.

Learn more

Top comments (2)

Collapse
 
socertis profile image
socertis

there is another important thing that i want to add to this answer,
that if you want to change the font size of code on github (which is the thing that i was searching for it for quite sometime), you can easily add
font-size: 14px;
right under the font-family:.... line.

Collapse
 
dinhanhx profile image
dinhanhx

I follow your method, it doesn't work.

AI Agent image

How to Build an AI Agent with Semantic Kernel (and More!)

Join Developer Advocate Luce Carter for a hands-on tutorial on building an AI-powered dinner recommendation agent. Discover how to integrate Microsoft Semantic Kernel, MongoDB Atlas, C#, and OpenAI for ingredient checks and smart restaurant suggestions.

Watch the video 📺

👋 Kindness is contagious

Dive into this insightful write-up, celebrated within the collaborative DEV Community. Developers at any stage are invited to contribute and elevate our shared skills.

A simple "thank you" can boost someone’s spirits—leave your kudos in the comments!

On DEV, exchanging ideas fuels progress and deepens our connections. If this post helped you, a brief note of thanks goes a long way.

Okay