From 2286c6a3eb03375c2f0b4f5fc17a4aebeeb9d1d8 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sun, 10 Dec 2023 21:52:07 +0100 Subject: [PATCH] Some a11y and Lighthouse testing --- astro.config.mjs | 3 +++ .../barlow-condensed/barlow-condensed.css | 18 ++++++++++++++++++ src/layouts/Basic.astro | 3 +-- src/layouts/NavbarLayout.astro | 2 +- src/layouts/PageLayout.astro | 2 +- src/pages/index.astro | 9 +++++---- 6 files changed, 29 insertions(+), 8 deletions(-) diff --git a/astro.config.mjs b/astro.config.mjs index b0badc4..8ec1022 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -12,6 +12,9 @@ export default defineConfig({ image: { service: sharpImageService() }, + experimental: { + optimizeHoistedScript: true, + }, compressHTML: true, site: "https://steamwar.de", integrations: [svelte(), tailwind(), configureI18n(), sitemap({ diff --git a/public/fonts/barlow-condensed/barlow-condensed.css b/public/fonts/barlow-condensed/barlow-condensed.css index 1633a43..3f21504 100644 --- a/public/fonts/barlow-condensed/barlow-condensed.css +++ b/public/fonts/barlow-condensed/barlow-condensed.css @@ -4,6 +4,7 @@ font-style: normal; font-weight: 100; src: local("Barlow Condensed Thin"), local("BarlowCondensed-Thin"), url(barlow-condensed-thin.woff2) format("woff2"); + font-display: swap; } /* barlow-condensed-thin-italic */ @font-face { @@ -11,6 +12,7 @@ font-style: italic; font-weight: 100; src: local("Barlow Condensed Thin Italic"), local("BarlowCondensed-ThinItalic"), url(barlow-condensed-thin-italic.woff2) format("woff2"); + font-display: swap; } /* barlow-condensed-extralight */ @font-face { @@ -18,6 +20,7 @@ font-style: normal; font-weight: 400; src: local("Barlow Condensed ExtraLight"), local("BarlowCondensed-ExtraLight"), url(barlow-condensed-extralight.woff2) format("woff2"); + font-display: swap; } /* barlow-condensed-extralight-italic */ @font-face { @@ -25,6 +28,7 @@ font-style: italic; font-weight: 400; src: local("Barlow Condensed ExtraLight Italic"), local("BarlowCondensed-ExtraLightItalic"), url(barlow-condensed-extralight-italic.woff2) format("woff2"); + font-display: swap; } /* barlow-condensed-light */ @font-face { @@ -32,6 +36,7 @@ font-style: normal; font-weight: 300; src: local("Barlow Condensed Light"), local("BarlowCondensed-Light"), url(barlow-condensed-light.woff2) format("woff2"); + font-display: swap; } /* barlow-condensed-light-italic */ @font-face { @@ -39,6 +44,7 @@ font-style: italic; font-weight: 300; src: local("Barlow Condensed Light Italic"), local("BarlowCondensed-LightItalic"), url(barlow-condensed-light-italic.woff2) format("woff2"); + font-display: swap; } /* barlow-condensed-regular */ @font-face { @@ -46,6 +52,7 @@ font-style: normal; font-weight: 400; src: local("Barlow Condensed Regular"), local("BarlowCondensed-Regular"), url(barlow-condensed-regular.woff2) format("woff2"); + font-display: swap; } /* barlow-condensed-italic */ @font-face { @@ -53,6 +60,7 @@ font-style: italic; font-weight: 400; src: local("Barlow Condensed Italic"), local("BarlowCondensed-Italic"), url(barlow-condensed-italic.woff2) format("woff2"); + font-display: swap; } /* barlow-condensed-medium */ @font-face { @@ -60,6 +68,7 @@ font-style: normal; font-weight: 500; src: local("Barlow Condensed Medium"), local("BarlowCondensed-Medium"), url(barlow-condensed-medium.woff2) format("woff2"); + font-display: swap; } /* barlow-condensed-medium-italic */ @font-face { @@ -67,6 +76,7 @@ font-style: italic; font-weight: 500; src: local("Barlow Condensed Medium Italic"), local("BarlowCondensed-MediumItalic"), url(barlow-condensed-medium-italic.woff2) format("woff2"); + font-display: swap; } /* barlow-condensed-semibold */ @font-face { @@ -74,6 +84,7 @@ font-style: normal; font-weight: 400; src: local("Barlow Condensed SemiBold"), local("BarlowCondensed-SemiBold"), url(barlow-condensed-semibold.woff2) format("woff2"); + font-display: swap; } /* barlow-condensed-semibold-italic */ @font-face { @@ -81,6 +92,7 @@ font-style: italic; font-weight: 400; src: local("Barlow Condensed SemiBold Italic"), local("BarlowCondensed-SemiBoldItalic"), url(barlow-condensed-semibold-italic.woff2) format("woff2"); + font-display: swap; } /* barlow-condensed-bold */ @font-face { @@ -88,6 +100,7 @@ font-style: normal; font-weight: 700; src: local("Barlow Condensed Bold"), local("BarlowCondensed-Bold"), url(barlow-condensed-bold.woff2) format("woff2"); + font-display: swap; } /* barlow-condensed-bold-italic */ @font-face { @@ -95,6 +108,7 @@ font-style: italic; font-weight: 700; src: local("Barlow Condensed Bold Italic"), local("BarlowCondensed-BoldItalic"), url(barlow-condensed-bold-italic.woff2) format("woff2"); + font-display: swap; } /* barlow-condensed-extrabold */ @font-face { @@ -102,6 +116,7 @@ font-style: normal; font-weight: 400; src: local("Barlow Condensed ExtraBold"), local("BarlowCondensed-ExtraBold"), url(barlow-condensed-extrabold.woff2) format("woff2"); + font-display: swap; } /* barlow-condensed-extrabold-italic */ @font-face { @@ -109,6 +124,7 @@ font-style: italic; font-weight: 400; src: local("Barlow Condensed ExtraBold Italic"), local("BarlowCondensed-ExtraBoldItalic"), url(barlow-condensed-extrabold-italic.woff2) format("woff2"); + font-display: swap; } /* barlow-condensed-black */ @font-face { @@ -116,6 +132,7 @@ font-style: normal; font-weight: 900; src: local("Barlow Condensed Black"), local("BarlowCondensed-Black"), url(barlow-condensed-black.woff2) format("woff2"); + font-display: swap; } /* barlow-condensed-black-italic */ @font-face { @@ -123,5 +140,6 @@ font-style: italic; font-weight: 900; src: local("Barlow Condensed Black Italic"), local("BarlowCondensed-BlackItalic"), url(barlow-condensed-black-italic.woff2) format("woff2"); + font-display: swap; } diff --git a/src/layouts/Basic.astro b/src/layouts/Basic.astro index 72c2048..78e6525 100644 --- a/src/layouts/Basic.astro +++ b/src/layouts/Basic.astro @@ -13,11 +13,10 @@ const iconImage = await getImage({src: icon, height: 32, width: 32, format: 'png + content="width=device-width, user-scalable=5, initial-scale=1.0, maximum-scale=5.0, minimum-scale=1.0"> - -