feat: mv profile to footer

This commit is contained in:
Julien Calixte
2026-03-28 20:24:08 +01:00
parent 10c3e1ca60
commit 20e9538983
11 changed files with 173 additions and 30 deletions

View File

@@ -6,7 +6,10 @@ const assembleFontLink = (font: string) => {
.replaceAll(" ", "+")}`
}
export const downloadFont = async (font: string): Promise<void> => {
export const downloadFont = async (
font: string,
cssVar = "--font-family"
): Promise<void> => {
const href = assembleFontLink(font)
// check if the href already exists
@@ -23,7 +26,7 @@ export const downloadFont = async (font: string): Promise<void> => {
try {
await new FontFaceObserver(font).load()
document.documentElement.style.setProperty("--font-family", font)
document.documentElement.style.setProperty(cssVar, font)
} catch (error) {
console.warn("error when loading font")
}