Improved font loading method for better performance

This commit is contained in:
Sodbileg Gansukh
2024-06-17 15:40:06 +08:00
parent 9a2f77a5b9
commit e860b018a3
8 changed files with 74 additions and 46 deletions

View File

@@ -0,0 +1,15 @@
{{!-- Sans-serif font is always loaded, because it's the default font for some part of the theme regardless of the settings --}}
{{> "fonts/sans"}}
{{#match @custom.title_font "Modern sans-serif"}}
{{#match @custom.body_font "Elegant serif"}}
{{> "fonts/serif"}}
{{/match}}
{{else match @custom.title_font "Elegant serif"}}
{{> "fonts/serif"}}
{{else}}
{{> "fonts/mono"}}
{{#match @custom.body_font "Elegant serif"}}
{{> "fonts/serif"}}
{{/match}}
{{/match}}