12
This commit is contained in:
@@ -250,6 +250,23 @@ const de = lang === "de";
|
|||||||
).then((r) => r.text());
|
).then((r) => r.text());
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
|
|
||||||
|
// ── NEU: Alle lokalen Link-Stylesheets fetchen (Astro Component CSS) ──
|
||||||
|
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"),
|
||||||
|
)
|
||||||
|
.map((href) =>
|
||||||
|
fetch(href)
|
||||||
|
.then((r) => r.text())
|
||||||
|
.catch(() => ""),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
).join("\n");
|
||||||
|
|
||||||
const inlineStyles = Array.from(document.querySelectorAll("style"))
|
const inlineStyles = Array.from(document.querySelectorAll("style"))
|
||||||
.map((s) => s.textContent)
|
.map((s) => s.textContent)
|
||||||
.join("\n");
|
.join("\n");
|
||||||
@@ -281,6 +298,7 @@ const de = lang === "de";
|
|||||||
<link href="${fontUrl}" rel="stylesheet">
|
<link href="${fontUrl}" rel="stylesheet">
|
||||||
<style>
|
<style>
|
||||||
${globalCss}
|
${globalCss}
|
||||||
|
${linkedCss}
|
||||||
${inlineStyles}
|
${inlineStyles}
|
||||||
html { margin: 0; padding: 0; }
|
html { margin: 0; padding: 0; }
|
||||||
body { margin: 0 !important; padding: 0 !important; display: flex; justify-content: center; background: white; }
|
body { margin: 0 !important; padding: 0 !important; display: flex; justify-content: center; background: white; }
|
||||||
|
|||||||
@@ -501,6 +501,23 @@ function j(v: any) {
|
|||||||
).then((r) => r.text());
|
).then((r) => r.text());
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
|
|
||||||
|
// ── NEU: Alle lokalen Link-Stylesheets fetchen (Astro Component CSS) ──
|
||||||
|
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"),
|
||||||
|
)
|
||||||
|
.map((href) =>
|
||||||
|
fetch(href)
|
||||||
|
.then((r) => r.text())
|
||||||
|
.catch(() => ""),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
).join("\n");
|
||||||
|
|
||||||
const inlineStyles = Array.from(document.querySelectorAll("style"))
|
const inlineStyles = Array.from(document.querySelectorAll("style"))
|
||||||
.map((s) => s.textContent)
|
.map((s) => s.textContent)
|
||||||
.join("\n");
|
.join("\n");
|
||||||
@@ -532,6 +549,7 @@ function j(v: any) {
|
|||||||
<link href="${fontUrl}" rel="stylesheet">
|
<link href="${fontUrl}" rel="stylesheet">
|
||||||
<style>
|
<style>
|
||||||
${globalCss}
|
${globalCss}
|
||||||
|
${linkedCss}
|
||||||
${inlineStyles}
|
${inlineStyles}
|
||||||
@page { size: A4 portrait; margin: 0; }
|
@page { size: A4 portrait; margin: 0; }
|
||||||
html { margin: 0; padding: 0; }
|
html { margin: 0; padding: 0; }
|
||||||
|
|||||||
Reference in New Issue
Block a user