Skip to content

Commit 9ebf3b7

Browse files
committed
events: don't vendor the embed font (it forced Atkinson site-wide)
The prior commit vendored Atkinson to /fonts/, which also satisfied the site's own (previously-broken) @font-face and forced Atkinson across the whole site. Drop the vendoring and the embed @font-face; the embed now mirrors the site's font declaration with no webfont, falling back to the reader's sans-serif like the rest of the site.
1 parent 7eaa99c commit 9ebf3b7

2 files changed

Lines changed: 9 additions & 34 deletions

File tree

scripts/aggregate-events.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -84,18 +84,6 @@ try {
8484
path.join(buildRoot, "purify.min.js"),
8585
);
8686
console.log("Copied purify.min.js to build root");
87-
88-
// Vendor the site's Atkinson Hyperlegible font next to the embed so the iframe
89-
// (a separate document that can't inherit the page's @font-face) renders in the
90-
// site font. Served at /fonts/; keep the weights in sync with the @font-face in
91-
// embed.html and static/css/custom.css.
92-
const fontsDir = path.join(buildRoot, "fonts");
93-
fs.mkdirSync(fontsDir, { recursive: true });
94-
for (const weight of ["400", "700"]) {
95-
const file = `atkinson-hyperlegible-latin-${weight}-normal.woff2`;
96-
fs.copyFileSync(path.join(__dirname, "..", "static", "fonts", file), path.join(fontsDir, file));
97-
}
98-
console.log("Copied Atkinson Hyperlegible fonts to build root /fonts");
9987
} catch (err) {
10088
console.error(`\nFailed to write build outputs: ${err.message}`);
10189
process.exit(1);

scripts/events/embed.html

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,11 @@
1717
<title>UC OSPO Network events</title>
1818
<link href="https://cdn.jsdelivr.net/npm/fullcalendar@6.1.15/index.global.min.css" rel="stylesheet" />
1919
<style>
20-
/* Site font (Atkinson Hyperlegible), mirrored from static/css/custom.css.
21-
The iframe is a separate document, so the @font-face must be redeclared
22-
here. MyST hashes files under static/, so the build (aggregate-events.js)
23-
vendors these woff2s to /fonts/ next to the embed, same as purify.min.js. */
24-
@font-face {
25-
font-family: "Atkinson Hyperlegible";
26-
font-style: normal;
27-
font-weight: 400;
28-
src: url("/fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");
29-
}
30-
@font-face {
31-
font-family: "Atkinson Hyperlegible";
32-
font-style: normal;
33-
font-weight: 700;
34-
src: url("/fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");
35-
}
3620
:root {
37-
/* Mirror the site brand palette + font (static/css/custom.css) so the
38-
embed matches the rest of the page. This iframe is a separate document
39-
and does NOT inherit the parent's --pst-* variables, so they're
40-
restated here. Change them in one place; keep in sync with custom.css. */
41-
--uco-font: "Atkinson Hyperlegible", sans-serif;
21+
/* Mirror the site brand palette (static/css/custom.css) so the embed
22+
matches the rest of the page. This iframe is a separate document and
23+
does NOT inherit the parent's --pst-* variables, so they're restated
24+
here. Change them in one place; keep in sync with custom.css. */
4225
--uco-primary: #003cb3; /* links, event tiles, button (--pst-color-link) */
4326
--uco-link-hover: #ff9100; /* --pst-color-link-hover */
4427
--uco-text: #222832; /* body / popover text (--tw-prose-body) */
@@ -66,7 +49,11 @@
6649
}
6750
body {
6851
margin: 0;
69-
font-family: var(--uco-font);
52+
/* Mirror the site's body font (static/css/custom.css) so the embed
53+
behaves the same way the rest of the site does. No @font-face here, so
54+
(like the site) this falls back to the reader's sans-serif unless
55+
Atkinson is installed locally. */
56+
font-family: "Atkinson Hyperlegible", sans-serif;
7057
color: var(--uco-text);
7158
/* The parent page sizes this iframe to fit its content, so an internal
7259
scrollbar is never needed; hide the sub-pixel-overflow one. */

0 commit comments

Comments
 (0)