This commit is contained in:
betalabor.de
2026-04-27 21:23:31 +02:00
parent 813dfbcbd9
commit 6513d2880e
2 changed files with 6 additions and 12 deletions

View File

@@ -249,16 +249,12 @@ const de = lang === "de";
`${window.location.origin}/styles/global.css`,
).then((r) => r.text());
} catch (e) {}
// ── NEU: Alle lokalen Link-Stylesheets fetchen (Astro Component CSS) ──
// ── NEU: Astro-generierte CSS-Dateien fetchen ──────────────────
const linkedCss = (
await Promise.all(
Array.from(document.querySelectorAll('link[rel="stylesheet"]'))
.map((l) => l.href)
.filter(
(href) =>
href.startsWith(origin) && !href.includes("fonts.googleapis"),
)
.filter((href) => href.startsWith(origin)) // nur lokale, keine Google Fonts
.map((href) =>
fetch(href)
.then((r) => r.text())
@@ -266,7 +262,7 @@ const de = lang === "de";
),
)
).join("\n");
// ───────────────────────────────────────────────────────────────
const inlineStyles = Array.from(document.querySelectorAll("style"))
.map((s) => s.textContent)
.join("\n");

View File

@@ -501,15 +501,12 @@ function j(v: any) {
).then((r) => r.text());
} catch (e) {}
// ── NEU: Alle lokalen Link-Stylesheets fetchen (Astro Component CSS) ──
// ── NEU: Astro-generierte CSS-Dateien fetchen ──────────────────
const linkedCss = (
await Promise.all(
Array.from(document.querySelectorAll('link[rel="stylesheet"]'))
.map((l) => l.href)
.filter(
(href) =>
href.startsWith(origin) && !href.includes("fonts.googleapis"),
)
.filter((href) => href.startsWith(origin)) // nur lokale, keine Google Fonts
.map((href) =>
fetch(href)
.then((r) => r.text())
@@ -517,6 +514,7 @@ function j(v: any) {
),
)
).join("\n");
// ───────────────────────────────────────────────────────────────
const inlineStyles = Array.from(document.querySelectorAll("style"))
.map((s) => s.textContent)