@rxova/brand 0.1.0 → 0.1.1

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.
Files changed (2) hide show
  1. package/package.json +14 -16
  2. package/src/fonts.css +229 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rxova/brand",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "description": "Design tokens, Starlight theme and shared site chrome for rxova.org",
6
6
  "keywords": [
@@ -18,7 +18,6 @@
18
18
  "url": "git+https://github.com/rxova/brand.git"
19
19
  },
20
20
  "bugs": "https://github.com/rxova/brand/issues",
21
- "packageManager": "pnpm@11.9.0",
22
21
  "engines": {
23
22
  "node": ">=20.19.0"
24
23
  },
@@ -48,19 +47,6 @@
48
47
  "optional": true
49
48
  }
50
49
  },
51
- "scripts": {
52
- "lint": "eslint .",
53
- "lint:fix": "eslint . --fix",
54
- "format": "prettier --write .",
55
- "format:check": "prettier --check .",
56
- "typecheck": "tsc --noEmit",
57
- "check:astro": "astro check",
58
- "check:exports": "node scripts/check-exports.mjs",
59
- "og": "node scripts/generate-og.mjs",
60
- "check:og": "node scripts/generate-og.mjs --check",
61
- "verify": "pnpm run format:check && pnpm run lint && pnpm run typecheck && pnpm run check:astro && pnpm run check:og && pnpm run check:exports",
62
- "prepare": "husky"
63
- },
64
50
  "dependencies": {
65
51
  "@fontsource/ibm-plex-mono": "^5.2.5",
66
52
  "@fontsource/space-grotesk": "^5.2.5"
@@ -93,5 +79,17 @@
93
79
  "prettier --write"
94
80
  ],
95
81
  "*.{json,jsonc,css,md,mdx,yaml,yml}": "prettier --write"
82
+ },
83
+ "scripts": {
84
+ "lint": "eslint .",
85
+ "lint:fix": "eslint . --fix",
86
+ "format": "prettier --write .",
87
+ "format:check": "prettier --check .",
88
+ "typecheck": "tsc --noEmit",
89
+ "check:astro": "astro check",
90
+ "check:exports": "node scripts/check-exports.mjs",
91
+ "og": "node scripts/generate-og.mjs",
92
+ "check:og": "node scripts/generate-og.mjs --check",
93
+ "verify": "pnpm run format:check && pnpm run lint && pnpm run typecheck && pnpm run check:astro && pnpm run check:og && pnpm run check:exports"
96
94
  }
97
- }
95
+ }
package/src/fonts.css CHANGED
@@ -10,14 +10,235 @@
10
10
  *
11
11
  * Weights are deliberately narrow — the ones the design system actually uses.
12
12
  * Adding a weight here costs every page on rxova.org, so add only on demand.
13
+ *
14
+ * The @font-face rules are declared here rather than `@import`ed from
15
+ * @fontsource's own per-weight stylesheets, for two reasons:
16
+ *
17
+ * 1. `font-display`. Fontsource hardcodes `swap`, which paints every page in
18
+ * the fallback face and then re-paints it in Space Grotesk — the flash of
19
+ * unstyled text you see on each navigation, because these are multi-page
20
+ * sites where every link click is a fresh document. `optional` removes it:
21
+ * the browser blocks invisibly for ~100ms, uses the font if it is there
22
+ * (which it is, from the HTTP cache, on every navigation after the first)
23
+ * and otherwise keeps the fallback for that page with no swap. There is no
24
+ * third state where text changes shape after paint.
25
+ * 2. Nested `@import` serialises. A consumer's stylesheet importing this file
26
+ * importing fontsource's meant the browser could not even discover the font
27
+ * URLs until two stylesheets had been fetched and parsed, which made the
28
+ * swap late enough to always be visible.
29
+ *
30
+ * Only woff2 is referenced — fontsource also ships woff, but every browser that
31
+ * runs an Astro 5 site supports woff2.
32
+ *
33
+ * These blocks are transcribed from @fontsource's own stylesheets (the
34
+ * unicode-ranges especially). When bumping either @fontsource dependency,
35
+ * re-check them against `node_modules/@fontsource/<pkg>/<weight>.css`.
13
36
  */
14
37
 
15
- /* Body, headings and UI. */
16
- @import '@fontsource/space-grotesk/400.css';
17
- @import '@fontsource/space-grotesk/500.css';
18
- @import '@fontsource/space-grotesk/600.css';
19
- @import '@fontsource/space-grotesk/700.css';
38
+ /* Space Grotesk 400 latin */
39
+ @font-face {
40
+ font-family: 'Space Grotesk';
41
+ font-style: normal;
42
+ font-weight: 400;
43
+ font-display: optional;
44
+ src: url('@fontsource/space-grotesk/files/space-grotesk-latin-400-normal.woff2') format('woff2');
45
+ unicode-range:
46
+ U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
47
+ U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
48
+ }
49
+
50
+ /* Space Grotesk 400 — latin-ext */
51
+ @font-face {
52
+ font-family: 'Space Grotesk';
53
+ font-style: normal;
54
+ font-weight: 400;
55
+ font-display: optional;
56
+ src: url('@fontsource/space-grotesk/files/space-grotesk-latin-ext-400-normal.woff2')
57
+ format('woff2');
58
+ unicode-range:
59
+ U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
60
+ U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
61
+ U+A720-A7FF;
62
+ }
63
+
64
+ /* Space Grotesk 400 — vietnamese */
65
+ @font-face {
66
+ font-family: 'Space Grotesk';
67
+ font-style: normal;
68
+ font-weight: 400;
69
+ font-display: optional;
70
+ src: url('@fontsource/space-grotesk/files/space-grotesk-vietnamese-400-normal.woff2')
71
+ format('woff2');
72
+ unicode-range:
73
+ U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301,
74
+ U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
75
+ }
76
+
77
+ /* Space Grotesk 500 — latin */
78
+ @font-face {
79
+ font-family: 'Space Grotesk';
80
+ font-style: normal;
81
+ font-weight: 500;
82
+ font-display: optional;
83
+ src: url('@fontsource/space-grotesk/files/space-grotesk-latin-500-normal.woff2') format('woff2');
84
+ unicode-range:
85
+ U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
86
+ U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
87
+ }
88
+
89
+ /* Space Grotesk 500 — latin-ext */
90
+ @font-face {
91
+ font-family: 'Space Grotesk';
92
+ font-style: normal;
93
+ font-weight: 500;
94
+ font-display: optional;
95
+ src: url('@fontsource/space-grotesk/files/space-grotesk-latin-ext-500-normal.woff2')
96
+ format('woff2');
97
+ unicode-range:
98
+ U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
99
+ U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
100
+ U+A720-A7FF;
101
+ }
102
+
103
+ /* Space Grotesk 500 — vietnamese */
104
+ @font-face {
105
+ font-family: 'Space Grotesk';
106
+ font-style: normal;
107
+ font-weight: 500;
108
+ font-display: optional;
109
+ src: url('@fontsource/space-grotesk/files/space-grotesk-vietnamese-500-normal.woff2')
110
+ format('woff2');
111
+ unicode-range:
112
+ U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301,
113
+ U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
114
+ }
115
+
116
+ /* Space Grotesk 600 — latin */
117
+ @font-face {
118
+ font-family: 'Space Grotesk';
119
+ font-style: normal;
120
+ font-weight: 600;
121
+ font-display: optional;
122
+ src: url('@fontsource/space-grotesk/files/space-grotesk-latin-600-normal.woff2') format('woff2');
123
+ unicode-range:
124
+ U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
125
+ U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
126
+ }
127
+
128
+ /* Space Grotesk 600 — latin-ext */
129
+ @font-face {
130
+ font-family: 'Space Grotesk';
131
+ font-style: normal;
132
+ font-weight: 600;
133
+ font-display: optional;
134
+ src: url('@fontsource/space-grotesk/files/space-grotesk-latin-ext-600-normal.woff2')
135
+ format('woff2');
136
+ unicode-range:
137
+ U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
138
+ U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
139
+ U+A720-A7FF;
140
+ }
141
+
142
+ /* Space Grotesk 600 — vietnamese */
143
+ @font-face {
144
+ font-family: 'Space Grotesk';
145
+ font-style: normal;
146
+ font-weight: 600;
147
+ font-display: optional;
148
+ src: url('@fontsource/space-grotesk/files/space-grotesk-vietnamese-600-normal.woff2')
149
+ format('woff2');
150
+ unicode-range:
151
+ U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301,
152
+ U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
153
+ }
154
+
155
+ /* Space Grotesk 700 — latin */
156
+ @font-face {
157
+ font-family: 'Space Grotesk';
158
+ font-style: normal;
159
+ font-weight: 700;
160
+ font-display: optional;
161
+ src: url('@fontsource/space-grotesk/files/space-grotesk-latin-700-normal.woff2') format('woff2');
162
+ unicode-range:
163
+ U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
164
+ U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
165
+ }
166
+
167
+ /* Space Grotesk 700 — latin-ext */
168
+ @font-face {
169
+ font-family: 'Space Grotesk';
170
+ font-style: normal;
171
+ font-weight: 700;
172
+ font-display: optional;
173
+ src: url('@fontsource/space-grotesk/files/space-grotesk-latin-ext-700-normal.woff2')
174
+ format('woff2');
175
+ unicode-range:
176
+ U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
177
+ U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
178
+ U+A720-A7FF;
179
+ }
180
+
181
+ /* Space Grotesk 700 — vietnamese */
182
+ @font-face {
183
+ font-family: 'Space Grotesk';
184
+ font-style: normal;
185
+ font-weight: 700;
186
+ font-display: optional;
187
+ src: url('@fontsource/space-grotesk/files/space-grotesk-vietnamese-700-normal.woff2')
188
+ format('woff2');
189
+ unicode-range:
190
+ U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301,
191
+ U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
192
+ }
193
+
194
+ /* IBM Plex Mono 400 — latin */
195
+ @font-face {
196
+ font-family: 'IBM Plex Mono';
197
+ font-style: normal;
198
+ font-weight: 400;
199
+ font-display: optional;
200
+ src: url('@fontsource/ibm-plex-mono/files/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
201
+ unicode-range:
202
+ U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
203
+ U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
204
+ }
205
+
206
+ /* IBM Plex Mono 400 — latin-ext */
207
+ @font-face {
208
+ font-family: 'IBM Plex Mono';
209
+ font-style: normal;
210
+ font-weight: 400;
211
+ font-display: optional;
212
+ src: url('@fontsource/ibm-plex-mono/files/ibm-plex-mono-latin-ext-400-normal.woff2')
213
+ format('woff2');
214
+ unicode-range:
215
+ U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
216
+ U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
217
+ U+A720-A7FF;
218
+ }
219
+
220
+ /* IBM Plex Mono 500 — latin */
221
+ @font-face {
222
+ font-family: 'IBM Plex Mono';
223
+ font-style: normal;
224
+ font-weight: 500;
225
+ font-display: optional;
226
+ src: url('@fontsource/ibm-plex-mono/files/ibm-plex-mono-latin-500-normal.woff2') format('woff2');
227
+ unicode-range:
228
+ U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
229
+ U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
230
+ }
20
231
 
21
- /* Code, package names and install snippets. */
22
- @import '@fontsource/ibm-plex-mono/400.css';
23
- @import '@fontsource/ibm-plex-mono/500.css';
232
+ /* IBM Plex Mono 500 latin-ext */
233
+ @font-face {
234
+ font-family: 'IBM Plex Mono';
235
+ font-style: normal;
236
+ font-weight: 500;
237
+ font-display: optional;
238
+ src: url('@fontsource/ibm-plex-mono/files/ibm-plex-mono-latin-ext-500-normal.woff2')
239
+ format('woff2');
240
+ unicode-range:
241
+ U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
242
+ U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
243
+ U+A720-A7FF;
244
+ }