From 503d8425c23f98906bc113375874d718bae34ddf Mon Sep 17 00:00:00 2001 From: Julien Oculi Date: Fri, 7 Jun 2024 10:25:55 +0200 Subject: [PATCH] feat(css): :sparkles: add fallback font-faces to avoid CLS --- src/stylesheets/base.css | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/src/stylesheets/base.css b/src/stylesheets/base.css index f79cec0..6678122 100644 --- a/src/stylesheets/base.css +++ b/src/stylesheets/base.css @@ -1,9 +1,37 @@ +@font-face { + font-family: 'Adjusted Lucida Bright Fallback'; + src: local(Lucida Bright); + size-adjust: 113%; + ascent-override: normal; + descent-override: 13%; + line-gap-override: normal; +} + +@font-face { + font-family: 'Adjusted Verdana Fallback'; + src: local(Verdana); + size-adjust: 93.5%; + ascent-override: 123%; + descent-override: 48%; + line-gap-override: normal; +} + +@font-face { + font-family: 'Adjusted Courier New Fallback'; + src: local(Courier New); + size-adjust: 100%; + ascent-override: 93%; + descent-override: 37%; + line-gap-override: normal; +} + :root { /* font */ --_font-size: var(--font-size-1); - --_font-family: 'MuseoModerno', sans-serif; - --_font-family-accent: 'Hepta Slab', serif; - --_font-family-code: 'Fira Code', monospace; + --_font-family: 'MuseoModerno', 'Adjusted Verdana Fallback', sans-serif; + --_font-family-accent: 'Hepta Slab', 'Adjusted Lucida Bright Fallback', + serif; + --_font-family-code: 'Fira Code', 'Adjusted Courier New Fallback', monospace; --_font-color: var(--choco-12); /* border */