aboutsummaryrefslogtreecommitdiff
path: root/Aamukampa.Web/Views.fs
diff options
context:
space:
mode:
authorJoel Stålnacke <joel@saker.fi>2025-09-28 15:27:46 +0300
committerJoel Stålnacke <joel@saker.fi>2025-09-28 15:27:46 +0300
commit2fada39cb389ae8f6c2797c33daa9b4a8e584ca6 (patch)
tree5cb4aa743a5209da2fcf84cab8e86df5cd3847dc /Aamukampa.Web/Views.fs
parent29c2b9089e70ef9b729e1a6a191848ca58fb470e (diff)
Vendor fonts
Fonts load faster
Diffstat (limited to 'Aamukampa.Web/Views.fs')
-rw-r--r--Aamukampa.Web/Views.fs17
1 files changed, 16 insertions, 1 deletions
diff --git a/Aamukampa.Web/Views.fs b/Aamukampa.Web/Views.fs
index 94392eb..021ea7e 100644
--- a/Aamukampa.Web/Views.fs
+++ b/Aamukampa.Web/Views.fs
@@ -14,9 +14,24 @@ module Document =
meta [ charset "utf-8" ]
meta [ name "viewport"; content "width=device-width" ]
Elem.title [] [ raw "Aamukampa" ]
+ let fontFile format = sprintf "%sfonts/CooperBlack-Regular.%s" Config.pathBase format
+ Elem.style [] [ raw <| sprintf """@font-face {
+ font-family: 'Cooper Black';
+ font-weight: normal;
+ font-style: normal;
+ font-display: swap;
+ src:
+ local('Cooper Black'),
+ url('%s') format('woff2'),
+ url('%s') format('woff'),
+ url('%s') format('opentype'),
+ url('%s') format('truetype');
+}
+""" (fontFile "woff2") (fontFile "woff") (fontFile "otf") (fontFile "ttf")
+ ]
link [ rel "stylesheet"; href (sprintf "%s%s" Config.pathBase "styles.css") ]
script [ type' "module"; src (sprintf "%s%s" Config.pathBase "app.js") ] []
- ]
+ ]
body [] [
documentBody
]