@rxova/brand 0.1.0 → 0.1.2

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 (3) hide show
  1. package/README.md +13 -2
  2. package/package.json +11 -37
  3. package/src/fonts.css +229 -8
package/README.md CHANGED
@@ -98,9 +98,14 @@ once and gets both modes for free.
98
98
 
99
99
  ## Development
100
100
 
101
+ The package lives in a two-package workspace — itself and `apps/preview`, a
102
+ Starlight site that renders it. Run everything from the repo root; Turbo fans the
103
+ tasks out and replays whatever the commit did not touch.
104
+
101
105
  ```sh
102
106
  pnpm install
103
- pnpm run verify # format, lint, tsc, astro check, social cards, package contract
107
+ pnpm run dev # the preview site the only place to *look* at the theme
108
+ pnpm run verify # audit, dedupe, format, lint, types, astro check, cards, contract
104
109
  pnpm run og # re-render the social cards after a palette or tagline change
105
110
  ```
106
111
 
@@ -119,7 +124,13 @@ are perfectly correct.
119
124
 
120
125
  ### Trying a change in a consumer
121
126
 
122
- The package has no `workspace:*` shortcut, so iterate through snapshot releases:
127
+ `apps/preview` links the package by `workspace:*`, so most changes can be seen
128
+ immediately with `pnpm run dev`. It cannot catch a `files` omission, though —
129
+ the link resolves to the source directory, where every file exists. That is what
130
+ `check:exports` is for.
131
+
132
+ For a real external consumer (the landing, a docs site), iterate through snapshot
133
+ releases:
123
134
 
124
135
  1. Add a changeset (`pnpm exec changeset`).
125
136
  2. Run the **Snapshot** workflow — publishes `0.x.y-next.N` to the `next` tag.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rxova/brand",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "description": "Design tokens, Starlight theme and shared site chrome for rxova.org",
6
6
  "keywords": [
@@ -15,10 +15,10 @@
15
15
  "homepage": "https://rxova.org",
16
16
  "repository": {
17
17
  "type": "git",
18
- "url": "git+https://github.com/rxova/brand.git"
18
+ "url": "git+https://github.com/rxova/brand.git",
19
+ "directory": "packages/brand"
19
20
  },
20
21
  "bugs": "https://github.com/rxova/brand/issues",
21
- "packageManager": "pnpm@11.9.0",
22
22
  "engines": {
23
23
  "node": ">=20.19.0"
24
24
  },
@@ -48,19 +48,6 @@
48
48
  "optional": true
49
49
  }
50
50
  },
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
51
  "dependencies": {
65
52
  "@fontsource/ibm-plex-mono": "^5.2.5",
66
53
  "@fontsource/space-grotesk": "^5.2.5"
@@ -68,30 +55,17 @@
68
55
  "devDependencies": {
69
56
  "@astrojs/check": "^0.9.9",
70
57
  "@astrojs/starlight": "^0.41.4",
71
- "@changesets/changelog-github": "^0.7.0",
72
- "@changesets/cli": "^2.29.7",
73
- "@commitlint/cli": "^21.2.1",
74
- "@commitlint/config-conventional": "^21.2.0",
75
- "@eslint/js": "^10.0.1",
76
58
  "@resvg/resvg-js": "^2.6.2",
77
59
  "@types/node": "^26.1.1",
78
60
  "astro": "^7.1.3",
79
- "eslint": "^10.7.0",
80
- "eslint-plugin-astro": "^1.3.0",
81
- "globals": "^17.6.0",
82
- "husky": "^9.1.7",
83
- "lint-staged": "^17.2.0",
84
- "prettier": "^3.9.6",
85
- "prettier-plugin-astro": "^0.14.0",
86
61
  "satori": "^0.29.0",
87
- "typescript": "6.0.3",
88
- "typescript-eslint": "^8.65.0"
62
+ "typescript": "6.0.3"
89
63
  },
90
- "lint-staged": {
91
- "*.{ts,tsx,astro,mjs,js}": [
92
- "eslint --fix",
93
- "prettier --write"
94
- ],
95
- "*.{json,jsonc,css,md,mdx,yaml,yml}": "prettier --write"
64
+ "scripts": {
65
+ "typecheck": "tsc --noEmit",
66
+ "check:astro": "astro check",
67
+ "check:exports": "node scripts/check-exports.mjs",
68
+ "og": "node scripts/generate-og.mjs",
69
+ "check:og": "node scripts/generate-og.mjs --check"
96
70
  }
97
- }
71
+ }
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
+ }