Use self-hosted Libron and Cal Sans fonts

Libron is the body serif and Cal Sans is used for headings and the header
nav, both under the SIL OFL with licences alongside the font files. Both
are preloaded so the header doesn't shift while Cal Sans loads. Also
nudge note text up and note/article metadata down in size.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Jonny Barnes 2026-10-17 14:59:29 +01:00
commit d2bc91794b
Signed by: jonny
SSH key fingerprint: SHA256:CTuSlns5U7qlD9jqHvtnVmfYV3Zwl2Z7WnJ4/dqOaL8
5 changed files with 264 additions and 2 deletions

View file

@ -2,6 +2,7 @@
@layer reset, base, components;
@import url('reset.css');
@import url('fonts.css');
@import url('colours.css');
@import url('layout.css');
@import url('header.css');

61
resources/css/fonts.css Normal file
View file

@ -0,0 +1,61 @@
/*
* Libron (serif, body text) and Cal Sans (sans, headings), both SIL OFL 1.1
* Libron v0.31: https://github.com/nicoverbruggen/libron/releases
* Cal Sans v2.011: https://github.com/calcom/sans/releases
*/
@font-face {
font-family: Libron;
src: url('/assets/fonts/libron/Libron-Regular.woff2') format('woff2');
font-weight: 400;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: Libron;
src: url('/assets/fonts/libron/Libron-Italic.woff2') format('woff2');
font-weight: 400;
font-style: italic;
font-display: swap;
}
@font-face {
font-family: Libron;
src: url('/assets/fonts/libron/Libron-Bold.woff2') format('woff2');
font-weight: 700;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: Libron;
src: url('/assets/fonts/libron/Libron-BoldItalic.woff2') format('woff2');
font-weight: 700;
font-style: italic;
font-display: swap;
}
@font-face {
font-family: 'Cal Sans';
src: url('/assets/fonts/cal-sans/CalSansVF.woff2') format('woff2');
font-weight: 400 700;
font-style: normal;
font-display: swap;
}
@layer base {
:root {
--font-serif: libron, georgia, serif;
--font-sans: 'Cal Sans', system-ui, sans-serif;
}
body {
font-family: var(--font-serif);
}
h1, h2, h3,
h4, h5, h6,
body > header nav {
font-family: var(--font-sans);
}
}

View file

@ -60,6 +60,10 @@
pre {
padding: 1rem;
}
.post-info {
font-size: 85%;
}
}
}

View file

@ -7,6 +7,8 @@
padding: 1ex 2ex;
.e-content {
font-size: 110%;
> p:first-child {
margin-block-start: 0;
}
@ -17,6 +19,10 @@
}
}
.note-metadata {
font-size: 85%;
}
.syndication-links {
display: flex;
flex-direction: row;

View file

@ -5,6 +5,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>@yield('title'){{ config('app.name') }}</title>
<link rel="preload" href="/assets/fonts/libron/Libron-Regular.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/assets/fonts/cal-sans/CalSansVF.woff2" as="font" type="font/woff2" crossorigin>
<link rel="stylesheet" href="/assets/highlight/nord.css">
<link rel="stylesheet" href="/assets/css/app.css">
<link rel="alternate" type="application/feed+json" title="Blog JSON Feed" href="{{ route('feed.blog.json') }}">