JetBrains Mono Font for e33.io

I’ve updated the site to use JetBrains Mono as the monospace font for code blocks and inline code. This free and open source font is designed by JetBrains.

JetBrains Mono’s typeface forms are simple and free from unnecessary details. Rendered in small sizes, the text looks crisper.

The easier the forms, the faster the eye perceives them and the less effort the brain needs to process them.

I used the @font-face rule to load the font files like this.

@font-face {
    font-family: 'JetBrains Mono';
    src: url('https://raw.githubusercontent.com/JetBrains/JetBrainsMono/master/fonts/webfonts/JetBrainsMono-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'JetBrains Mono';
    src: url('https://raw.githubusercontent.com/JetBrains/JetBrainsMono/master/fonts/webfonts/JetBrainsMono-Italic.woff2') format('woff2');
    font-weight: normal;
    font-style: italic;
}

Then I styled the code elements like this.

pre,
code {
	color: #fff;
	background: #1a1a1a;
	font-family: 'JetBrains Mono', Menlo, Consolas, 'Liberation Mono', monospace;
	font-variant-numeric: slashed-zero;
	font-variant-ligatures: none;
	font-size: 1rem;
}
pre {
	padding: 1rem;
}
:not(pre) > code {
	border-radius: 0.25rem;
	padding: 0 0.1rem;
}

The font-variant styles are opinionated styles that I think make it easier to read and follow all the code characters, and I use Prism for the syntax highlighting.