@cosxai/ui 0.3.4 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/styles/fonts.css +22 -20
- package/src/styles/tokens.css +19 -4
package/package.json
CHANGED
package/src/styles/fonts.css
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
/*
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
importing this file. */
|
|
1
|
+
/* Web-font loading for the kit's typographic vocabulary.
|
|
2
|
+
Loaded from Google Fonts CDN — Geist + Geist Mono cover the
|
|
3
|
+
default sans/mono slots; Playfair Display drives the editorial
|
|
4
|
+
chrome's display heading; Caveat covers the sketch chrome's
|
|
5
|
+
handwritten display. All four are SIL OFL — free to redistribute.
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
Why Google Fonts CDN over self-hosting:
|
|
8
|
+
1. Self-hosted /fonts/*.otf had to be shipped per-consumer
|
|
9
|
+
(the previous setup), and consumers that forgot returned
|
|
10
|
+
SPA index.html for the font URL, surfacing a noisy
|
|
11
|
+
"Failed to decode downloaded font" warning in every
|
|
12
|
+
production console.
|
|
13
|
+
2. The CDN handles font-display, variable-font subsetting,
|
|
14
|
+
and per-browser format selection automatically; we just
|
|
15
|
+
consume the @import.
|
|
16
|
+
3. font-display=swap means the system fallback paints first,
|
|
17
|
+
the web font upgrades on arrival — no FOIT.
|
|
15
18
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
19
|
+
For offline / enterprise deploys that block Google Fonts, a
|
|
20
|
+
consumer can override --ck-font-sans/serif/mono in tokens.css
|
|
21
|
+
to fall back entirely to the system-font slot at the tail of
|
|
22
|
+
each stack. */
|
|
23
|
+
|
|
24
|
+
@import url("https://fonts.googleapis.com/css2?family=Geist:wght@300..700&family=Geist+Mono:wght@400..700&family=Playfair+Display:wght@400..900&family=Caveat:wght@400..700&display=swap");
|
package/src/styles/tokens.css
CHANGED
|
@@ -13,10 +13,25 @@
|
|
|
13
13
|
serif (editorial body), and display (headlines). By default
|
|
14
14
|
display = sans so headings inherit the same neutral grotesk;
|
|
15
15
|
editorial chrome overrides display → serif to flip headlines
|
|
16
|
-
to a high-contrast serif without touching component code.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
to a high-contrast serif without touching component code.
|
|
17
|
+
|
|
18
|
+
Each stack ends with CJK system-font fallbacks before the
|
|
19
|
+
generic family so 中文 / 日本語 / 한국어 don't drop to the
|
|
20
|
+
browser's last-resort glyph (renders as tofu on locked-down
|
|
21
|
+
hosts). Browsers do per-character fallback — Latin hits
|
|
22
|
+
Geist/Playfair, CJK hits the matching system serif/sans. We
|
|
23
|
+
deliberately don't load a Noto SC web font here: every modern
|
|
24
|
+
OS ships PingFang SC (macOS / iOS), Microsoft YaHei
|
|
25
|
+
(Windows), or Source Han Sans (Android / ChromeOS), and the
|
|
26
|
+
extra ~150KB Google Fonts request to serve users a font they
|
|
27
|
+
already have is bad citizenship. */
|
|
28
|
+
--ck-font-sans: "Geist", "Inter", system-ui, -apple-system,
|
|
29
|
+
"PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
|
|
30
|
+
"Source Han Sans SC", sans-serif;
|
|
31
|
+
--ck-font-mono: "Geist Mono", "JetBrains Mono", ui-monospace, "SF Mono", Menlo,
|
|
32
|
+
"Sarasa Mono SC", monospace;
|
|
33
|
+
--ck-font-serif: "Playfair Display", "GT Sectra", "Canela", Georgia,
|
|
34
|
+
"Songti SC", "STSong", "Source Han Serif SC", serif;
|
|
20
35
|
--ck-font-display: var(--ck-font-sans);
|
|
21
36
|
|
|
22
37
|
/* ---------- Radii / motion ---------- */
|