From: Ben Harris Date: Sun, 19 Oct 2025 09:58:17 +0000 (+0100) Subject: Add stylesheet to plain text files in .htaccess X-Git-Tag: bedstead-3.261~26 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~bjharris/git?a=commitdiff_plain;h=f8b7e0a91f03030f490cdab5edcd44d0a99c2d6c;p=bedstead.git Add stylesheet to plain text files in .htaccess It turns out that Firefox (version 140 at least) will happily use an HTTP Link header for a CSS stylesheet on a plain text file. It works a bit weirdly because it applies the stylesheet to the HTML conversion of the file, but that actually means that the existing bedstead.css works pretty well. This doesn't work on Chromium, but that's no worse than what we've already got. --- diff --git a/.htaccess b/.htaccess index d2a504d..6ff3a55 100644 --- a/.htaccess +++ b/.htaccess @@ -3,6 +3,7 @@ AddType application/xhtml+xml;charset=UTF-8 .xhtml AddType font/otf;outlines=CFF .otf ForceType text/plain + Header add Link "; rel=stylesheet type=\"text/css\"" AddOutputFilterByType DEFLATE application/xhtml+xml text/css font/otf \ application/javascript application/wasm \