diff options
| author | grm <grm@eyesin.space> | 2026-09-17 22:54:19 +0300 |
|---|---|---|
| committer | grm <grm@eyesin.space> | 2026-09-17 22:54:19 +0300 |
| commit | ad30b38759dc222a7137598559998acbd0c06740 (patch) | |
| tree | ee6f00b03a32420dd70211ade20684697b325086 /internal/web/web_test.go | |
| parent | 9d3ab1b781a712b73311d2f2b0b822ae02de99ff (diff) | |
| download | blogspace-ad30b38759dc222a7137598559998acbd0c06740.tar.gz blogspace-ad30b38759dc222a7137598559998acbd0c06740.tar.bz2 blogspace-ad30b38759dc222a7137598559998acbd0c06740.zip | |
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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Sd8UPWrvyYCLj97JexNw3A
Diffstat (limited to 'internal/web/web_test.go')
| -rw-r--r-- | internal/web/web_test.go | 5 |
1 files changed, 5 insertions, 0 deletions
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 |
