summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Florian Lefebvre <contact@florian-lefebvre.dev> 2025-04-16 09:59:46 +0200
committerGravatar GitHub <noreply@github.com> 2025-04-16 09:59:46 +0200
commitf1311d2acb6dd7a75f7ea10eea3a02fbe674eb2a (patch)
treee0dc489a68177402052aabb997d408432a8e0dfc
parent3838efe5028256e0e28bf823f868bcda6ef1e775 (diff)
downloadastro-f1311d2acb6dd7a75f7ea10eea3a02fbe674eb2a.tar.gz
astro-f1311d2acb6dd7a75f7ea10eea3a02fbe674eb2a.tar.zst
astro-f1311d2acb6dd7a75f7ea10eea3a02fbe674eb2a.zip
fix(fonts): component ordering (#13625)
-rw-r--r--.changeset/thick-walls-open.md5
-rw-r--r--packages/astro/components/Font.astro2
2 files changed, 6 insertions, 1 deletions
diff --git a/.changeset/thick-walls-open.md b/.changeset/thick-walls-open.md
new file mode 100644
index 000000000..f56826c8c
--- /dev/null
+++ b/.changeset/thick-walls-open.md
@@ -0,0 +1,5 @@
+---
+'astro': patch
+---
+
+Updates the `<Font />` component so that preload links are generated before the style tag if `preload` is passed
diff --git a/packages/astro/components/Font.astro b/packages/astro/components/Font.astro
index 53d26ea36..13b464ce4 100644
--- a/packages/astro/components/Font.astro
+++ b/packages/astro/components/Font.astro
@@ -23,10 +23,10 @@ if (!data) {
}
---
-<style set:html={data.css}></style>
{
preload &&
data.preloadData.map(({ url, type }) => (
<link rel="preload" href={url} as="font" type={`font/${type}`} crossorigin />
))
}
+<style set:html={data.css}></style>