@fldr/ui 0.3.4 → 0.3.6

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.
@@ -20,7 +20,7 @@
20
20
  --color-kumo-base: light-dark(#ffffff, #1c1c1b);
21
21
  --color-kumo-tint: light-dark(#f6f5f2, #2b2a28);
22
22
  --color-kumo-control: light-dark(#ffffff, #191918);
23
- --color-kumo-line: light-dark(rgb(25 25 24 / 0.1), #41403d);
23
+ --color-kumo-line: light-dark(rgb(25 25 24 / 0.16), #4f4e4a);
24
24
  --color-kumo-hairline: light-dark(#ecebe7, #2b2a28);
25
25
  --color-kumo-focus: light-dark(
26
26
  oklch(0.5772 0.2324 260),
@@ -43,7 +43,7 @@
43
43
  --color-kumo-base: #ffffff;
44
44
  --color-kumo-tint: #f6f5f2;
45
45
  --color-kumo-control: #ffffff;
46
- --color-kumo-line: rgb(25 25 24 / 0.1);
46
+ --color-kumo-line: rgb(25 25 24 / 0.16);
47
47
  --color-kumo-hairline: #ecebe7;
48
48
  --color-kumo-focus: oklch(0.5772 0.2324 260);
49
49
  }
@@ -63,7 +63,7 @@
63
63
  --color-kumo-base: #1c1c1b;
64
64
  --color-kumo-tint: #2b2a28;
65
65
  --color-kumo-control: #191918;
66
- --color-kumo-line: #41403d;
66
+ --color-kumo-line: #4f4e4a;
67
67
  --color-kumo-hairline: #2b2a28;
68
68
  --color-kumo-focus: oklch(70.7% 0.165 254.624);
69
69
  }
@@ -99,7 +99,7 @@
99
99
  oklch(49.1% 0.27 292.581),
100
100
  oklch(60.6% 0.25 292.717)
101
101
  );
102
- --color-kumo-line: light-dark(rgb(25 25 24 / 0.1), #41403d);
102
+ --color-kumo-line: light-dark(rgb(25 25 24 / 0.16), #4f4e4a);
103
103
  --color-kumo-hairline: light-dark(#ecebe7, #2b2a28);
104
104
  --color-kumo-focus: light-dark(
105
105
  oklch(54.1% 0.281 293.009),
@@ -124,7 +124,7 @@
124
124
  --color-kumo-control: #ffffff;
125
125
  --color-kumo-brand: oklch(54.1% 0.281 293.009);
126
126
  --color-kumo-brand-hover: oklch(49.1% 0.27 292.581);
127
- --color-kumo-line: rgb(25 25 24 / 0.1);
127
+ --color-kumo-line: rgb(25 25 24 / 0.16);
128
128
  --color-kumo-hairline: #ecebe7;
129
129
  --color-kumo-focus: oklch(54.1% 0.281 293.009);
130
130
  }
@@ -146,7 +146,7 @@
146
146
  --color-kumo-control: #191918;
147
147
  --color-kumo-brand: oklch(54.1% 0.281 293.009);
148
148
  --color-kumo-brand-hover: oklch(60.6% 0.25 292.717);
149
- --color-kumo-line: #41403d;
149
+ --color-kumo-line: #4f4e4a;
150
150
  --color-kumo-hairline: #2b2a28;
151
151
  --color-kumo-focus: oklch(54.1% 0.281 293.009);
152
152
  }
@@ -182,7 +182,7 @@
182
182
  oklch(43.2% 0.095 166.913),
183
183
  oklch(59.6% 0.145 163.225)
184
184
  );
185
- --color-kumo-line: light-dark(rgb(25 25 24 / 0.1), #41403d);
185
+ --color-kumo-line: light-dark(rgb(25 25 24 / 0.16), #4f4e4a);
186
186
  --color-kumo-hairline: light-dark(#ecebe7, #2b2a28);
187
187
  --color-kumo-focus: light-dark(
188
188
  oklch(50.8% 0.118 165.612),
@@ -207,7 +207,7 @@
207
207
  --color-kumo-control: #ffffff;
208
208
  --color-kumo-brand: oklch(50.8% 0.118 165.612);
209
209
  --color-kumo-brand-hover: oklch(43.2% 0.095 166.913);
210
- --color-kumo-line: rgb(25 25 24 / 0.1);
210
+ --color-kumo-line: rgb(25 25 24 / 0.16);
211
211
  --color-kumo-hairline: #ecebe7;
212
212
  --color-kumo-focus: oklch(50.8% 0.118 165.612);
213
213
  }
@@ -229,7 +229,7 @@
229
229
  --color-kumo-control: #191918;
230
230
  --color-kumo-brand: oklch(50.8% 0.118 165.612);
231
231
  --color-kumo-brand-hover: oklch(59.6% 0.145 163.225);
232
- --color-kumo-line: #41403d;
232
+ --color-kumo-line: #4f4e4a;
233
233
  --color-kumo-hairline: #2b2a28;
234
234
  --color-kumo-focus: oklch(50.8% 0.118 165.612);
235
235
  }
@@ -265,7 +265,7 @@
265
265
  oklch(47% 0.157 37.304),
266
266
  oklch(64.6% 0.222 41.116)
267
267
  );
268
- --color-kumo-line: light-dark(rgb(25 25 24 / 0.1), #41403d);
268
+ --color-kumo-line: light-dark(rgb(25 25 24 / 0.16), #4f4e4a);
269
269
  --color-kumo-hairline: light-dark(#ecebe7, #2b2a28);
270
270
  --color-kumo-focus: light-dark(
271
271
  oklch(55.3% 0.195 38.402),
@@ -290,7 +290,7 @@
290
290
  --color-kumo-control: #ffffff;
291
291
  --color-kumo-brand: oklch(55.3% 0.195 38.402);
292
292
  --color-kumo-brand-hover: oklch(47% 0.157 37.304);
293
- --color-kumo-line: rgb(25 25 24 / 0.1);
293
+ --color-kumo-line: rgb(25 25 24 / 0.16);
294
294
  --color-kumo-hairline: #ecebe7;
295
295
  --color-kumo-focus: oklch(55.3% 0.195 38.402);
296
296
  }
@@ -312,7 +312,7 @@
312
312
  --color-kumo-control: #191918;
313
313
  --color-kumo-brand: oklch(55.3% 0.195 38.402);
314
314
  --color-kumo-brand-hover: oklch(64.6% 0.222 41.116);
315
- --color-kumo-line: #41403d;
315
+ --color-kumo-line: #4f4e4a;
316
316
  --color-kumo-hairline: #2b2a28;
317
317
  --color-kumo-focus: oklch(55.3% 0.195 38.402);
318
318
  }
@@ -348,7 +348,7 @@
348
348
  oklch(51.4% 0.222 16.935),
349
349
  oklch(64.5% 0.246 16.439)
350
350
  );
351
- --color-kumo-line: light-dark(rgb(25 25 24 / 0.1), #41403d);
351
+ --color-kumo-line: light-dark(rgb(25 25 24 / 0.16), #4f4e4a);
352
352
  --color-kumo-hairline: light-dark(#ecebe7, #2b2a28);
353
353
  --color-kumo-focus: light-dark(
354
354
  oklch(58.6% 0.253 17.585),
@@ -373,7 +373,7 @@
373
373
  --color-kumo-control: #ffffff;
374
374
  --color-kumo-brand: oklch(58.6% 0.253 17.585);
375
375
  --color-kumo-brand-hover: oklch(51.4% 0.222 16.935);
376
- --color-kumo-line: rgb(25 25 24 / 0.1);
376
+ --color-kumo-line: rgb(25 25 24 / 0.16);
377
377
  --color-kumo-hairline: #ecebe7;
378
378
  --color-kumo-focus: oklch(58.6% 0.253 17.585);
379
379
  }
@@ -395,7 +395,7 @@
395
395
  --color-kumo-control: #191918;
396
396
  --color-kumo-brand: oklch(58.6% 0.253 17.585);
397
397
  --color-kumo-brand-hover: oklch(64.5% 0.246 16.439);
398
- --color-kumo-line: #41403d;
398
+ --color-kumo-line: #4f4e4a;
399
399
  --color-kumo-hairline: #2b2a28;
400
400
  --color-kumo-focus: oklch(58.6% 0.253 17.585);
401
401
  }
@@ -419,7 +419,7 @@
419
419
  --color-kumo-control: light-dark(#ffffff, #191918);
420
420
  --color-kumo-brand: light-dark(#191918, #41403d);
421
421
  --color-kumo-brand-hover: light-dark(#2b2a28, #5a5955);
422
- --color-kumo-line: light-dark(rgb(25 25 24 / 0.1), #41403d);
422
+ --color-kumo-line: light-dark(rgb(25 25 24 / 0.16), #4f4e4a);
423
423
  --color-kumo-hairline: light-dark(#ecebe7, #2b2a28);
424
424
  --color-kumo-focus: light-dark(#191918, #41403d);
425
425
  }
@@ -441,7 +441,7 @@
441
441
  --color-kumo-control: #ffffff;
442
442
  --color-kumo-brand: #191918;
443
443
  --color-kumo-brand-hover: #2b2a28;
444
- --color-kumo-line: rgb(25 25 24 / 0.1);
444
+ --color-kumo-line: rgb(25 25 24 / 0.16);
445
445
  --color-kumo-hairline: #ecebe7;
446
446
  --color-kumo-focus: #191918;
447
447
  }
@@ -463,12 +463,24 @@
463
463
  --color-kumo-control: #191918;
464
464
  --color-kumo-brand: #41403d;
465
465
  --color-kumo-brand-hover: #5a5955;
466
- --color-kumo-line: #41403d;
466
+ --color-kumo-line: #4f4e4a;
467
467
  --color-kumo-hairline: #2b2a28;
468
468
  --color-kumo-focus: #41403d;
469
469
  }
470
470
  }
471
471
 
472
+ /* Kumo density "comfortable". Generated by generateDensityCSS(). */
473
+ @layer base {
474
+ :root,
475
+ [data-density="comfortable"] {
476
+ --spacing: 0.24rem;
477
+ --text-xs: 11.67px;
478
+ --text-sm: 12.67px;
479
+ --text-base: 13.67px;
480
+ --text-lg: 15.67px;
481
+ }
482
+ }
483
+
472
484
  /* Kumo density "compact". Generated by generateDensityCSS(). */
473
485
  @layer base {
474
486
  [data-density="compact"] {
package/dist/theming.d.ts CHANGED
@@ -42,6 +42,8 @@ interface KumoDensity {
42
42
  spacing: string;
43
43
  /** Font sizes and line heights. */
44
44
  typography?: Partial<Record<KumoTypographyToken, string>>;
45
+ /** Also apply on `:root`, so pages without `data-density` get this scale. */
46
+ default?: boolean;
45
47
  }
46
48
  export declare function defineDensity<const T extends KumoDensity>(density: T): T;
47
49
  /** Generate the CSS for a density. Load it after Kumo's styles. */
@@ -103,8 +105,8 @@ export declare const fldrTheme: {
103
105
  readonly dark: "#191918";
104
106
  };
105
107
  readonly "kumo-line": {
106
- readonly light: "rgb(25 25 24 / 0.1)";
107
- readonly dark: "#41403d";
108
+ readonly light: "rgb(25 25 24 / 0.16)";
109
+ readonly dark: "#4f4e4a";
108
110
  };
109
111
  readonly "kumo-hairline": {
110
112
  readonly light: "#ecebe7";
@@ -135,6 +137,21 @@ export declare const compactDensity: {
135
137
  readonly lg: "15px";
136
138
  };
137
139
  };
140
+ /**
141
+ * fldr's default scale, a third of the way from Kumo's stock size to compact:
142
+ * 13.67px body text. Applies on `:root`, so it needs no attribute.
143
+ */
144
+ export declare const comfortableDensity: {
145
+ readonly name: "comfortable";
146
+ readonly default: true;
147
+ readonly spacing: "0.24rem";
148
+ readonly typography: {
149
+ readonly xs: "11.67px";
150
+ readonly sm: "12.67px";
151
+ readonly base: "13.67px";
152
+ readonly lg: "15.67px";
153
+ };
154
+ };
138
155
  //#endregion
139
156
  //#region src/themes/index.d.ts
140
157
  /**
@@ -196,8 +213,8 @@ export declare const BUILT_IN_THEMES: (KumoTheme | {
196
213
  readonly dark: "#191918";
197
214
  };
198
215
  readonly "kumo-line": {
199
- readonly light: "rgb(25 25 24 / 0.1)";
200
- readonly dark: "#41403d";
216
+ readonly light: "rgb(25 25 24 / 0.16)";
217
+ readonly dark: "#4f4e4a";
201
218
  };
202
219
  readonly "kumo-hairline": {
203
220
  readonly light: "#ecebe7";
@@ -210,7 +227,17 @@ export declare const BUILT_IN_THEMES: (KumoTheme | {
210
227
  };
211
228
  })[];
212
229
  /** Densities shipped in `theme-fldr.css`, applied with `data-density="<name>"`. */
213
- export declare const BUILT_IN_DENSITIES: {
230
+ export declare const BUILT_IN_DENSITIES: ({
231
+ readonly name: "comfortable";
232
+ readonly default: true;
233
+ readonly spacing: "0.24rem";
234
+ readonly typography: {
235
+ readonly xs: "11.67px";
236
+ readonly sm: "12.67px";
237
+ readonly base: "13.67px";
238
+ readonly lg: "15.67px";
239
+ };
240
+ } | {
214
241
  readonly name: "compact";
215
242
  readonly spacing: "0.22rem";
216
243
  readonly typography: {
@@ -219,6 +246,6 @@ export declare const BUILT_IN_DENSITIES: {
219
246
  readonly base: "13px";
220
247
  readonly lg: "15px";
221
248
  };
222
- }[];
249
+ })[];
223
250
  //#endregion
224
251
  export type { ColorMode, KumoColorToken, KumoDensity, KumoTextToken, KumoTheme, KumoTypographyToken };
package/dist/theming.js CHANGED
@@ -181,7 +181,7 @@ function defineDensity(density) {
181
181
  }
182
182
  /** Generate the CSS for a density. Load it after Kumo's styles. */
183
183
  function generateDensityCSS(density) {
184
- const { name, spacing, typography = {} } = density;
184
+ const { name, spacing, typography = {}, default: isDefault } = density;
185
185
  if (!NAME.test(name)) throw new Error(`Invalid density name "${name}": use lowercase letters, digits and dashes`);
186
186
  assertKnown("typography", Object.keys(typography), THEME_CONFIG.typography);
187
187
  const lines = [` --spacing: ${spacing};`];
@@ -189,7 +189,7 @@ function generateDensityCSS(density) {
189
189
  return [
190
190
  `/* Kumo density "${name}". Generated by generateDensityCSS(). */`,
191
191
  "@layer base {",
192
- ` [data-density="${name}"] {`,
192
+ ` ${isDefault ? ":root, " : ""}[data-density="${name}"] {`,
193
193
  ...lines,
194
194
  " }",
195
195
  "}",
@@ -253,8 +253,8 @@ const fldrTheme = defineTheme({
253
253
  dark: "#191918"
254
254
  },
255
255
  "kumo-line": {
256
- light: "rgb(25 25 24 / 0.1)",
257
- dark: "#41403d"
256
+ light: "rgb(25 25 24 / 0.16)",
257
+ dark: "#4f4e4a"
258
258
  },
259
259
  "kumo-hairline": {
260
260
  light: "#ecebe7",
@@ -365,6 +365,21 @@ const compactDensity = defineDensity({
365
365
  lg: "15px"
366
366
  }
367
367
  });
368
+ /**
369
+ * fldr's default scale, a third of the way from Kumo's stock size to compact:
370
+ * 13.67px body text. Applies on `:root`, so it needs no attribute.
371
+ */
372
+ const comfortableDensity = defineDensity({
373
+ name: "comfortable",
374
+ default: true,
375
+ spacing: "0.24rem",
376
+ typography: {
377
+ xs: "11.67px",
378
+ sm: "12.67px",
379
+ base: "13.67px",
380
+ lg: "15.67px"
381
+ }
382
+ });
368
383
  //#endregion
369
384
  //#region src/themes/index.ts
370
385
  /**
@@ -381,6 +396,6 @@ const BUILT_IN_THEMES = [
381
396
  fldrInkTheme
382
397
  ];
383
398
  /** Densities shipped in `theme-fldr.css`, applied with `data-density="<name>"`. */
384
- const BUILT_IN_DENSITIES = [compactDensity];
399
+ const BUILT_IN_DENSITIES = [comfortableDensity, compactDensity];
385
400
  //#endregion
386
- export { BUILT_IN_DENSITIES, BUILT_IN_THEMES, compactDensity, defineDensity, defineTheme, extendTheme, fldrGreenTheme, fldrInkTheme, fldrOrangeTheme, fldrRoseTheme, fldrTheme, fldrVioletTheme, generateDensityCSS, generateThemeCSS };
401
+ export { BUILT_IN_DENSITIES, BUILT_IN_THEMES, comfortableDensity, compactDensity, defineDensity, defineTheme, extendTheme, fldrGreenTheme, fldrInkTheme, fldrOrangeTheme, fldrRoseTheme, fldrTheme, fldrVioletTheme, generateDensityCSS, generateThemeCSS };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fldr/ui",
3
- "version": "0.3.4",
3
+ "version": "0.3.6",
4
4
  "private": false,
5
5
  "description": "fldr's design system: Cloudflare Kumo with a theme authoring API and PandaCSS preset",
6
6
  "keywords": [