From ad30b38759dc222a7137598559998acbd0c06740 Mon Sep 17 00:00:00 2001 From: grm Date: Thu, 17 Sep 2026 22:54:19 +0300 Subject: Add Fira Code as a built-in font choice The variable face (v6.2, OFL, licence alongside) is bundled in static/ and declared as @font-face whenever the text or heading font is "fira"; the stack falls back through Fira Mono, Menlo and Consolas to Courier. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01Sd8UPWrvyYCLj97JexNw3A --- internal/web/web_test.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'internal/web/web_test.go') diff --git a/internal/web/web_test.go b/internal/web/web_test.go index 1ca2677..a7c189f 100644 --- a/internal/web/web_test.go +++ b/internal/web/web_test.go @@ -131,6 +131,11 @@ func TestThemeNormalizeAndCSS(t *testing.T) { if css := DefaultTheme().CSS(); strings.Contains(css, "@font-face") || strings.Contains(css, "h1, h2") { t.Errorf("default css should declare no font faces or heading rule: %s", css) } + // Fira Code is the one built-in choice that is a web font: its face is declared when either font uses it. + css = ThemeFromForm(DefaultTheme(), url.Values{"heading_font": {"fira"}}).CSS() + if !strings.Contains(css, `@font-face { font-family:"Fira Code"; src:url(/static/FiraCode-VF.woff2)`) || !strings.Contains(css, `h1, h2, h3, h4, h5, h6 { font-family:"Fira Code", "Fira Mono"`) { + t.Errorf("fira css: %s", css) + } } // The rule under titles is a body class blog.css draws from, coloured by the -- cgit v1.2.3