From 53fa7ab1b12689b9cdc4e1a80e00162b0f5bc930 Mon Sep 17 00:00:00 2001 From: Sin-Kang Date: Thu, 29 Oct 2026 16:23:45 +0900 Subject: [PATCH 1/4] fix(site-kit): add atomic UI font opt-in and compatible overlays --- .changeset/atomic-family-font-opt-in.md | 5 + packages/site-kit/README.ko.md | 11 + packages/site-kit/README.md | 11 + packages/site-kit/fonts-atomic.css | 111 +++++++ packages/site-kit/fonts/manifest.json | 8 +- .../fonts/pretendard/PretendardVariable.woff2 | Bin 0 -> 2057688 bytes packages/site-kit/package.json | 13 +- packages/site-kit/scripts/build-fonts.mjs | 49 +++- packages/site-kit/src/core/fonts.d.mts | 5 + packages/site-kit/src/core/fonts.mjs | 5 + scripts/pack-font-overlay.mjs | 273 ++++++++++++++++++ scripts/verify-site-kit-release.mjs | 8 +- tests/font-overlay.test.mjs | 155 ++++++++++ tests/site-kit-contracts.test.mjs | 30 +- tests/site-kit-core.test.mjs | 12 + 15 files changed, 687 insertions(+), 9 deletions(-) create mode 100644 .changeset/atomic-family-font-opt-in.md create mode 100644 packages/site-kit/fonts-atomic.css create mode 100644 packages/site-kit/fonts/pretendard/PretendardVariable.woff2 create mode 100644 scripts/pack-font-overlay.mjs create mode 100644 tests/font-overlay.test.mjs diff --git a/.changeset/atomic-family-font-opt-in.md b/.changeset/atomic-family-font-opt-in.md new file mode 100644 index 0000000..f5df6c3 --- /dev/null +++ b/.changeset/atomic-family-font-opt-in.md @@ -0,0 +1,5 @@ +--- +"@devslab/site-kit": patch +--- + +Add an opt-in atomic Korean UI font stylesheet, additive pure preload exports, and reproducible font-only overlays while preserving legacy subset CSS and asset paths. diff --git a/packages/site-kit/README.ko.md b/packages/site-kit/README.ko.md index ac3a503..4997733 100644 --- a/packages/site-kit/README.ko.md +++ b/packages/site-kit/README.ko.md @@ -511,3 +511,14 @@ import하는 소비자는 kit 전체로 클라이언트 JS ~150 KB가 아니라 `pnpm check`가 최소 소비자(`fixtures/bundle-probe`)를 빌드해 국기 본문이 메인 청크로 되돌아오면 실패시킨다. 본문은 서버 렌더 HTML에는 여전히 실린다 — 가져오는 파일로 옮기는 것은 별도 결정이다. + + +### Atomic UI font opt-in + +Keep legacy fonts.css for consumers that require its subset-and-swap behavior. Products that need stable first-paint UI text can replace that import with @devslab/site-kit/fonts-atomic.css. Import one stylesheet, not both. The opt-in keeps the same DDS family names and fallback token stack. It uses one complete unmodified Pretendard 1.3.9 WOFF2 without unicode-range/local(), and optional display for Geist, Geist Mono and Pretendard. A slow first visit may retain system fallback for that page; it does not promise that every visit uses the custom font. + +Use the pure ESM @devslab/site-kit/fonts subpath and fontPreloadLinks([geistLatinUrl, fullKoreanUrl]) in the initial HTML/head. Vite application imports use @devslab/site-kit/fonts/geist/geist-latin-wght-normal.woff2?url and @devslab/site-kit/fonts/pretendard/PretendardVariable.woff2?url, so preload and CSS refer to identical content-hashed files. FAMILY_FONT_PRELOAD_FILE is the existing Latin path; FAMILY_FONT_ATOMIC_FILE is the complete Korean path; FAMILY_FONT_MONO_FILE is available when the initial screen uses mono text. Plain HTML/Vite consumers may generate head links from final emitted asset URLs in their HTML build step. Late client-side JS is not an early preload. + +fontPreloadLinks still accepts only same-origin absolute WOFF2 URLs and supplies type font/woff2 plus anonymous CORS mode. The CSS keeps external same-origin URLs; no inline/data font or CSP expansion is required. Content-hashed public WOFF2 caching belongs to the consuming application asset response. Do not change HTML, API or account cache policy as part of a font cache rule. + +Both stylesheets and the complete font are generated/verified from fonts/manifest.json. The full font is 2,057,688 bytes, SHA256 9599f12fd42fc0bce1cd50b47a0c022e108d7aa64dd0d1bb0ed44f3282d900b4, from pretendard@1.3.9 dist/web/variable/woff2/PretendardVariable.woff2. It shares the packaged OFL-1.1 license with the preserved upstream subsets. This opt-in does not copy application-specific inline critical fonts or calibrated local font metrics; consumers must verify real first-paint glyphs/layout under cold, warm and delayed font loading. diff --git a/packages/site-kit/README.md b/packages/site-kit/README.md index 9b33122..531f376 100644 --- a/packages/site-kit/README.md +++ b/packages/site-kit/README.md @@ -490,3 +490,14 @@ does not exist. `LocaleMenu` renders a native `