@classic-homes/theme-styles 0.10.0 → 0.13.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/README.md CHANGED
@@ -25,17 +25,28 @@ The main entry defines the cascade layers, brand fonts, tokens, base, accessibil
25
25
 
26
26
  ## Exports
27
27
 
28
- | Import | Contents |
29
- | --------------------------------------------- | ---------------------------------------------------------- |
30
- | `@classic-homes/theme-styles` | All styles (fonts, tokens, base, accessibility, utilities) |
31
- | `@classic-homes/theme-styles/core` | Same as the main entry, without the brand fonts |
32
- | `@classic-homes/theme-styles/fonts` | Brand fonts |
33
- | `@classic-homes/theme-styles/base` | Base element styles |
34
- | `@classic-homes/theme-styles/accessibility` | Accessibility styles |
35
- | `@classic-homes/theme-styles/utilities` | Utility classes |
36
- | `@classic-homes/theme-styles/tailwind-v4` | The theme for Tailwind CSS 4 (see below) |
37
- | `@classic-homes/theme-styles/components.css` | Plain CSS `ch-*` component classes (see below) |
38
- | `@classic-homes/theme-styles/components.json` | The `ch-*` class list as data (recipe, axis, option) |
28
+ | Import | Contents |
29
+ | --------------------------------------------- | ---------------------------------------------------------------- |
30
+ | `@classic-homes/theme-styles` | All styles (fonts, tokens, base, accessibility, utilities, fold) |
31
+ | `@classic-homes/theme-styles/core` | Same as the main entry, without the brand fonts |
32
+ | `@classic-homes/theme-styles/fonts` | Brand fonts |
33
+ | `@classic-homes/theme-styles/base` | Base element styles |
34
+ | `@classic-homes/theme-styles/accessibility` | Accessibility styles |
35
+ | `@classic-homes/theme-styles/utilities` | Utility classes |
36
+ | `@classic-homes/theme-styles/fold` | Foldable layout rules (see below) |
37
+ | `@classic-homes/theme-styles/tailwind-v4` | The theme for Tailwind CSS 4 (see below) |
38
+ | `@classic-homes/theme-styles/components.css` | Plain CSS `ch-*` component classes (see below) |
39
+ | `@classic-homes/theme-styles/components.json` | The `ch-*` class list as data (recipe, axis, option) |
40
+
41
+ ### Foldable phones (iPhone Duo)
42
+
43
+ While a foldable is partly open, the Classic Theme iOS shell sets `<html data-fold="vertical|horizontal">` and `--fold-left/-top/-width/-height` (`@classic-homes/native`, Foldable). `fold.css` (in both entry points) then keeps content out of the fold; with no active fold, and everywhere else, it does nothing:
44
+
45
+ - the `Header` mobile menu stays in one pane;
46
+ - a full-width layout's main region (`main#main-content` without a sidebar before it, as in `PublicLayout`) is centred on a vertical fold, and its two-column grids (`grid-cols-2`, `md:grid-cols-2`, …) widen their gap to the fold, so the gap lands on it. Add `.fold-center` to centre another full-width element, `.fold-gap` to widen another grid's gap;
47
+ - `.fold-split` lays its first two children out one per pane, for an element that starts at the viewport's left (or top) edge, such as a full-screen view.
48
+
49
+ Its rules are unlayered so they win over the page's own utilities while folded.
39
50
 
40
51
  ### Touch field size
41
52
 
@@ -97,6 +108,7 @@ Generated from the recipes; `node scripts/build-components-css.mjs --readme` rew
97
108
  | ----------------------------------- | ------------------------------------------------ |
98
109
  | `ch-btn` | `button` recipe (base + defaults) |
99
110
  | `ch-btn-secondary` | `variant: secondary` |
111
+ | `ch-btn-promo` | `variant: promo` |
100
112
  | `ch-btn-destructive` | `variant: destructive` |
101
113
  | `ch-btn-outline` | `variant: outline` |
102
114
  | `ch-btn-ghost` | `variant: ghost` |
@@ -107,11 +119,19 @@ Generated from the recipes; `node scripts/build-components-css.mjs --readme` rew
107
119
  | `ch-btn-icon` | `size: icon` |
108
120
  | `ch-badge` | `badge` recipe (base + defaults) |
109
121
  | `ch-badge-secondary` | `variant: secondary` |
110
- | `ch-badge-destructive` | `variant: destructive` |
111
122
  | `ch-badge-outline` | `variant: outline` |
123
+ | `ch-badge-live` | `variant: live` |
124
+ | `ch-badge-working` | `variant: working` |
125
+ | `ch-badge-off` | `variant: off` |
126
+ | `ch-badge-attention` | `variant: attention` |
127
+ | `ch-badge-critical` | `variant: critical` |
128
+ | `ch-badge-promo` | `variant: promo` |
129
+ | `ch-badge-count` | `variant: count` |
130
+ | `ch-badge-quantity` | `variant: quantity` |
112
131
  | `ch-badge-success` | `variant: success` |
113
- | `ch-badge-warning` | `variant: warning` |
114
132
  | `ch-badge-info` | `variant: info` |
133
+ | `ch-badge-warning` | `variant: warning` |
134
+ | `ch-badge-destructive` | `variant: destructive` |
115
135
  | `ch-badge-sm` | `size: sm` |
116
136
  | `ch-badge-dot` | `size: dot` |
117
137
  | `ch-badge-clickable` | `clickable: true` |
@@ -211,6 +231,7 @@ Generated from the recipes; `node scripts/build-components-css.mjs --readme` rew
211
231
  | `ch-table-header` | `tableHeader` recipe (base) |
212
232
  | `ch-table-body` | `tableBody` recipe (base) |
213
233
  | `ch-table-row` | `tableRow` recipe (base + defaults) |
234
+ | `ch-table-row-striped` | `striped: true` |
214
235
  | `ch-table-row-interactive` | `interactive: true` |
215
236
  | `ch-table-row-selected` | `selected: true` |
216
237
  | `ch-table-head` | `tableHead` recipe (base + defaults) |
@@ -180,18 +180,22 @@
180
180
  pointer-events: none;
181
181
  opacity: 0.5;
182
182
  }
183
- .ch-btn:where(:not(.ch-btn-secondary, .ch-btn-destructive, .ch-btn-outline, .ch-btn-ghost, .ch-btn-link)) {
183
+ .ch-btn:where(:not(.ch-btn-secondary, .ch-btn-promo, .ch-btn-destructive, .ch-btn-outline, .ch-btn-ghost, .ch-btn-link)) {
184
184
  background-color: hsl(var(--primary));
185
185
  color: hsl(var(--primary-foreground));
186
+ text-underline-offset: 4px;
186
187
  --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
187
188
  --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);
188
189
  box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
189
190
  }
190
191
  @media (hover: hover) and (pointer: fine) {
191
- .ch-btn:where(:not(.ch-btn-secondary, .ch-btn-destructive, .ch-btn-outline, .ch-btn-ghost, .ch-btn-link)):hover {
192
- background-color: hsl(var(--primary-hover));
192
+ .ch-btn:where(:not(.ch-btn-secondary, .ch-btn-promo, .ch-btn-destructive, .ch-btn-outline, .ch-btn-ghost, .ch-btn-link)):hover {
193
+ text-decoration-line: underline;
193
194
  }
194
195
  }
196
+ .ch-btn:where(:not(.ch-btn-secondary, .ch-btn-promo, .ch-btn-destructive, .ch-btn-outline, .ch-btn-ghost, .ch-btn-link)):active {
197
+ background-color: hsl(var(--primary-active));
198
+ }
195
199
  .ch-btn-secondary {
196
200
  border-width: 2px;
197
201
  border-color: hsl(var(--secondary-border));
@@ -206,6 +210,24 @@
206
210
  background-color: hsl(var(--secondary-hover));
207
211
  }
208
212
  }
213
+ .ch-btn-secondary:active {
214
+ background-color: hsl(var(--muted-hover));
215
+ }
216
+ .ch-btn-promo {
217
+ background-color: hsl(var(--promo));
218
+ color: hsl(var(--promo-foreground));
219
+ --tw-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
220
+ --tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);
221
+ box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
222
+ }
223
+ @media (hover: hover) and (pointer: fine) {
224
+ .ch-btn-promo:hover {
225
+ background-color: hsl(var(--promo-hover));
226
+ }
227
+ }
228
+ .ch-btn-promo:active {
229
+ background-color: hsl(var(--promo-hover));
230
+ }
209
231
  .ch-btn-destructive {
210
232
  background-color: hsl(var(--destructive));
211
233
  color: hsl(var(--destructive-foreground));
@@ -218,9 +240,6 @@
218
240
  background-color: hsl(var(--destructive-hover));
219
241
  }
220
242
  }
221
- .ch-btn-destructive:focus-visible {
222
- --tw-ring-color: hsl(var(--destructive));
223
- }
224
243
  .ch-btn-outline {
225
244
  border-width: 2px;
226
245
  border-color: hsl(var(--outline));
@@ -229,9 +248,7 @@
229
248
  }
230
249
  @media (hover: hover) and (pointer: fine) {
231
250
  .ch-btn-outline:hover {
232
- border-color: hsl(var(--outline-hover));
233
- background-color: hsl(var(--primary));
234
- color: hsl(var(--primary-foreground));
251
+ background-color: hsl(var(--muted));
235
252
  }
236
253
  .ch-btn-ghost:hover {
237
254
  background-color: hsl(var(--muted-hover));
@@ -239,12 +256,13 @@
239
256
  }
240
257
  }
241
258
  .ch-btn-link {
242
- color: hsl(var(--primary));
259
+ color: hsl(var(--link));
260
+ text-decoration-line: underline;
243
261
  text-underline-offset: 4px;
244
262
  }
245
263
  @media (hover: hover) and (pointer: fine) {
246
264
  .ch-btn-link:hover {
247
- text-decoration-line: underline;
265
+ text-decoration-thickness: 2px;
248
266
  }
249
267
  }
250
268
  .ch-btn:where(:not(.ch-btn-sm, .ch-btn-md, .ch-btn-lg, .ch-btn-icon)) {
@@ -292,38 +310,93 @@
292
310
  border-width: 1px;
293
311
  font-weight: 500;
294
312
  }
295
- .ch-badge:where(:not(.ch-badge-secondary, .ch-badge-destructive, .ch-badge-outline, .ch-badge-success, .ch-badge-warning, .ch-badge-info)) {
313
+ .ch-badge:where(:not(.ch-badge-secondary, .ch-badge-outline, .ch-badge-live, .ch-badge-working, .ch-badge-off, .ch-badge-attention, .ch-badge-critical, .ch-badge-promo, .ch-badge-count, .ch-badge-quantity, .ch-badge-success, .ch-badge-info, .ch-badge-warning, .ch-badge-destructive)) {
296
314
  border-color: transparent;
297
315
  background-color: hsl(var(--primary));
298
316
  color: hsl(var(--primary-foreground));
299
317
  }
300
318
  .ch-badge-secondary {
301
- border-color: transparent;
319
+ border-color: hsl(var(--secondary-border));
302
320
  background-color: hsl(var(--secondary));
303
321
  color: hsl(var(--secondary-foreground));
304
322
  }
305
- .ch-badge-destructive {
323
+ .ch-badge-outline {
324
+ color: hsl(var(--foreground));
325
+ }
326
+ .ch-badge-live {
327
+ border-color: transparent;
328
+ background-color: hsl(var(--live));
329
+ font-weight: 700;
330
+ color: hsl(var(--live-foreground));
331
+ }
332
+ .ch-badge-working {
333
+ border-color: transparent;
334
+ background-color: hsl(var(--accent));
335
+ font-weight: 700;
336
+ color: hsl(var(--accent-foreground));
337
+ }
338
+ .ch-badge-off {
339
+ border-color: hsl(var(--outline-hover));
340
+ background-color: hsl(var(--background));
341
+ font-weight: 700;
342
+ color: hsl(var(--foreground));
343
+ }
344
+ .ch-badge-attention {
345
+ border-color: hsl(var(--destructive));
346
+ background-color: hsl(var(--background));
347
+ font-weight: 700;
348
+ color: hsl(var(--destructive));
349
+ }
350
+ .ch-badge-critical {
306
351
  border-color: transparent;
307
352
  background-color: hsl(var(--destructive));
353
+ font-weight: 700;
308
354
  color: hsl(var(--destructive-foreground));
309
355
  }
310
- .ch-badge-outline {
311
- color: hsl(var(--foreground));
356
+ .ch-badge-promo {
357
+ border-color: hsl(var(--promo));
358
+ background-color: hsl(var(--background));
359
+ font-weight: 700;
360
+ text-transform: uppercase;
361
+ letter-spacing: 0.07em;
362
+ color: hsl(var(--promo));
312
363
  }
313
- .ch-badge-success {
364
+ .ch-badge-count {
365
+ border-radius: 9999px;
314
366
  border-color: transparent;
315
- background-color: hsl(var(--success));
316
- color: hsl(var(--success-foreground));
367
+ background-color: hsl(var(--promo));
368
+ font-weight: 700;
369
+ color: hsl(var(--promo-foreground));
317
370
  }
318
- .ch-badge-warning {
371
+ .ch-badge-quantity {
319
372
  border-color: transparent;
320
- background-color: hsl(var(--warning));
321
- color: hsl(var(--warning-foreground));
373
+ background-color: hsl(var(--accent));
374
+ font-weight: 700;
375
+ color: hsl(var(--accent-foreground));
376
+ }
377
+ .ch-badge-success {
378
+ border-color: transparent;
379
+ background-color: hsl(var(--live));
380
+ font-weight: 700;
381
+ color: hsl(var(--live-foreground));
322
382
  }
323
383
  .ch-badge-info {
324
384
  border-color: transparent;
325
- background-color: hsl(var(--info));
326
- color: hsl(var(--info-foreground));
385
+ background-color: hsl(var(--live));
386
+ font-weight: 700;
387
+ color: hsl(var(--live-foreground));
388
+ }
389
+ .ch-badge-warning {
390
+ border-color: hsl(var(--destructive));
391
+ background-color: hsl(var(--background));
392
+ font-weight: 700;
393
+ color: hsl(var(--destructive));
394
+ }
395
+ .ch-badge-destructive {
396
+ border-color: transparent;
397
+ background-color: hsl(var(--destructive));
398
+ font-weight: 700;
399
+ color: hsl(var(--destructive-foreground));
327
400
  }
328
401
  .ch-badge:where(:not(.ch-badge-sm, .ch-badge-dot)) {
329
402
  padding-left: 0.5rem;
@@ -343,13 +416,22 @@
343
416
  }
344
417
  .ch-badge-dot {
345
418
  height: 1.25rem;
346
- width: 1.25rem;
347
- padding: 0;
419
+ min-width: 1.25rem;
420
+ padding-left: 0.375rem;
421
+ padding-right: 0.375rem;
422
+ padding-top: 0;
423
+ padding-bottom: 0;
348
424
  font-size: 0.75rem;
349
425
  line-height: 1rem;
350
426
  }
351
427
  .ch-badge-clickable {
352
428
  cursor: pointer;
429
+ text-underline-offset: 2px;
430
+ }
431
+ @media (hover: hover) and (pointer: fine) {
432
+ .ch-badge-clickable:hover {
433
+ text-decoration-line: underline;
434
+ }
353
435
  }
354
436
  .ch-badge-clickable:focus {
355
437
  outline: 2px solid transparent;
@@ -361,7 +443,7 @@
361
443
  --tw-ring-offset-width: 2px;
362
444
  }
363
445
  @media (hover: hover) and (pointer: fine) {
364
- .ch-badge:where(:not(.ch-badge-secondary, .ch-badge-destructive, .ch-badge-outline, .ch-badge-success, .ch-badge-warning, .ch-badge-info)).ch-badge-clickable:hover {
446
+ .ch-badge:where(:not(.ch-badge-secondary, .ch-badge-outline, .ch-badge-live, .ch-badge-working, .ch-badge-off, .ch-badge-attention, .ch-badge-critical, .ch-badge-promo, .ch-badge-count, .ch-badge-quantity, .ch-badge-success, .ch-badge-info, .ch-badge-warning, .ch-badge-destructive)).ch-badge-clickable:hover {
365
447
  background-color: hsl(var(--primary-hover));
366
448
  }
367
449
  .ch-badge.ch-badge-secondary.ch-badge-clickable:hover {
@@ -370,18 +452,26 @@
370
452
  .ch-badge.ch-badge-destructive.ch-badge-clickable:hover {
371
453
  background-color: hsl(var(--destructive-hover));
372
454
  }
455
+ .ch-badge.ch-badge-critical.ch-badge-clickable:hover {
456
+ background-color: hsl(var(--destructive-hover));
457
+ }
458
+ .ch-badge.ch-badge-count.ch-badge-clickable:hover {
459
+ background-color: hsl(var(--promo-hover));
460
+ }
373
461
  .ch-badge.ch-badge-outline.ch-badge-clickable:hover {
374
- background-color: hsl(var(--accent-hover));
375
- color: hsl(var(--accent-foreground));
462
+ background-color: hsl(var(--muted));
463
+ }
464
+ .ch-badge.ch-badge-off.ch-badge-clickable:hover {
465
+ background-color: hsl(var(--muted));
376
466
  }
377
- .ch-badge.ch-badge-success.ch-badge-clickable:hover {
378
- background-color: hsl(var(--success) / 0.8);
467
+ .ch-badge.ch-badge-attention.ch-badge-clickable:hover {
468
+ background-color: hsl(var(--muted));
379
469
  }
380
470
  .ch-badge.ch-badge-warning.ch-badge-clickable:hover {
381
- background-color: hsl(var(--warning) / 0.8);
471
+ background-color: hsl(var(--muted));
382
472
  }
383
- .ch-badge.ch-badge-info.ch-badge-clickable:hover {
384
- background-color: hsl(var(--info) / 0.8);
473
+ .ch-badge.ch-badge-promo.ch-badge-clickable:hover {
474
+ background-color: hsl(var(--muted));
385
475
  }
386
476
  }
387
477
  /* card */
@@ -408,11 +498,11 @@
408
498
  }
409
499
  .ch-card-highlight {
410
500
  border-width: 2px;
411
- border-color: var(--color-core-1);
501
+ border-color: hsl(var(--primary));
412
502
  }
413
503
  .ch-card-warning {
414
504
  border-width: 2px;
415
- border-color: var(--color-red-primary);
505
+ border-color: hsl(var(--destructive));
416
506
  }
417
507
  .ch-card-interactive {
418
508
  transition-property: box-shadow;
@@ -499,45 +589,50 @@
499
589
  padding-left: 1.75rem;
500
590
  }
501
591
  .ch-alert:where(:not(.ch-alert-destructive, .ch-alert-error, .ch-alert-success, .ch-alert-warning, .ch-alert-info)) {
502
- border-color: hsl(var(--border));
503
- background-color: hsl(var(--muted) / 0.5);
592
+ border-color: hsl(var(--accent));
593
+ background-color: hsl(var(--background));
504
594
  color: hsl(var(--foreground));
505
595
  }
506
596
  .ch-alert-destructive {
507
- border-color: hsl(var(--destructive) / 0.4);
508
- background-color: hsl(var(--destructive) / 0.1);
597
+ border-width: 2px;
598
+ border-color: hsl(var(--destructive));
599
+ background-color: hsl(var(--background));
509
600
  color: hsl(var(--foreground));
510
601
  }
511
602
  .ch-alert-destructive>svg {
512
603
  color: hsl(var(--destructive));
513
604
  }
514
605
  .ch-alert-error {
515
- border-color: hsl(var(--destructive) / 0.4);
516
- background-color: hsl(var(--destructive) / 0.1);
606
+ border-width: 2px;
607
+ border-color: hsl(var(--destructive));
608
+ background-color: hsl(var(--background));
517
609
  color: hsl(var(--foreground));
518
610
  }
519
611
  .ch-alert-error>svg {
520
612
  color: hsl(var(--destructive));
521
613
  }
522
614
  .ch-alert-success {
523
- border-color: hsl(var(--success) / 0.4);
524
- background-color: hsl(var(--success) / 0.1);
615
+ border-width: 2px;
616
+ border-color: hsl(var(--success));
617
+ background-color: hsl(var(--background));
525
618
  color: hsl(var(--foreground));
526
619
  }
527
620
  .ch-alert-success>svg {
528
621
  color: hsl(var(--success));
529
622
  }
530
623
  .ch-alert-warning {
531
- border-color: hsl(var(--warning) / 0.4);
532
- background-color: hsl(var(--warning) / 0.1);
624
+ border-width: 2px;
625
+ border-color: hsl(var(--warning));
626
+ background-color: hsl(var(--background));
533
627
  color: hsl(var(--foreground));
534
628
  }
535
629
  .ch-alert-warning>svg {
536
630
  color: hsl(var(--warning));
537
631
  }
538
632
  .ch-alert-info {
539
- border-color: hsl(var(--info) / 0.4);
540
- background-color: hsl(var(--info) / 0.1);
633
+ border-width: 2px;
634
+ border-color: hsl(var(--info));
635
+ background-color: hsl(var(--background));
541
636
  color: hsl(var(--foreground));
542
637
  }
543
638
  .ch-alert-info>svg {
@@ -606,11 +701,9 @@
606
701
  }
607
702
  }
608
703
  .ch-input-invalid {
704
+ border-width: 2px;
609
705
  border-color: hsl(var(--destructive));
610
706
  }
611
- .ch-input-invalid:focus-visible {
612
- --tw-ring-color: hsl(var(--destructive));
613
- }
614
707
  /* textarea */
615
708
  .ch-textarea {
616
709
  display: flex;
@@ -632,7 +725,7 @@
632
725
  }
633
726
  .ch-textarea::placeholder {
634
727
  --tw-text-opacity: 1;
635
- color: rgb(122 122 122 / var(--tw-text-opacity, 1));
728
+ color: rgb(118 117 116 / var(--tw-text-opacity, 1));
636
729
  }
637
730
  .ch-textarea:focus-visible {
638
731
  outline: 2px solid transparent;
@@ -658,11 +751,9 @@
658
751
  }
659
752
  }
660
753
  .ch-textarea-invalid {
754
+ border-width: 2px;
661
755
  border-color: hsl(var(--destructive));
662
756
  }
663
- .ch-textarea-invalid:focus-visible {
664
- --tw-ring-color: hsl(var(--destructive));
665
- }
666
757
  /* label */
667
758
  .ch-label {
668
759
  font-size: 0.875rem;
@@ -722,11 +813,9 @@
722
813
  -webkit-line-clamp: 1;
723
814
  }
724
815
  .ch-select-invalid {
816
+ border-width: 2px;
725
817
  border-color: hsl(var(--destructive));
726
818
  }
727
- .ch-select-invalid:focus {
728
- --tw-ring-color: hsl(var(--destructive));
729
- }
730
819
  /* selectContent */
731
820
  .ch-select-content {
732
821
  position: relative;
@@ -1282,7 +1371,7 @@
1282
1371
  /* tableHeader */
1283
1372
  .ch-table-header {
1284
1373
  border-bottom-width: 1px;
1285
- background-color: hsl(var(--muted) / 0.5);
1374
+ background-color: hsl(var(--accent));
1286
1375
  }
1287
1376
  /* tableBody */
1288
1377
  .ch-table-body > :not([hidden]) ~ :not([hidden]) {
@@ -1294,16 +1383,38 @@
1294
1383
  .ch-table-row {
1295
1384
  background-color: hsl(var(--card));
1296
1385
  }
1386
+ .ch-table-row-striped:nth-child(even) {
1387
+ background-color: hsl(var(--row-zebra));
1388
+ }
1297
1389
  .ch-table-row-interactive {
1298
1390
  cursor: pointer;
1299
1391
  }
1300
1392
  @media (hover: hover) and (pointer: fine) {
1301
1393
  .ch-table-row-interactive:hover {
1302
- background-color: hsl(var(--muted-hover));
1394
+ background-color: hsl(var(--row-hover));
1303
1395
  }
1304
1396
  }
1305
1397
  .ch-table-row-selected {
1306
- background-color: hsl(var(--primary) / 0.05);
1398
+ background-color: hsl(var(--row-selected));
1399
+ font-weight: 600;
1400
+ }
1401
+ .ch-table-row-selected:nth-child(even) {
1402
+ background-color: hsl(var(--row-selected));
1403
+ }
1404
+ @media (hover: hover) and (pointer: fine) {
1405
+ .ch-table-row-selected:hover {
1406
+ background-color: hsl(var(--row-selected));
1407
+ }
1408
+ }
1409
+ .ch-table-row-selected>td:first-child {
1410
+ --tw-shadow: inset 3px 0 0 hsl(var(--primary));
1411
+ --tw-shadow-colored: inset 3px 0 0 var(--tw-shadow-color);
1412
+ box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
1413
+ }
1414
+ @media (hover: hover) and (pointer: fine) {
1415
+ .ch-table-row.ch-table-row-striped.ch-table-row-interactive:where(:not(.ch-table-row-selected)):hover {
1416
+ background-color: hsl(var(--row-hover-zebra));
1417
+ }
1307
1418
  }
1308
1419
  /* tableHead */
1309
1420
  .ch-table-head {
@@ -1311,8 +1422,8 @@
1311
1422
  padding-right: 1rem;
1312
1423
  padding-top: 0.75rem;
1313
1424
  padding-bottom: 0.75rem;
1314
- font-weight: 500;
1315
- color: hsl(var(--muted-foreground));
1425
+ font-weight: 600;
1426
+ color: hsl(var(--foreground));
1316
1427
  }
1317
1428
  .ch-table-head:where(:not(.ch-table-head-center, .ch-table-head-right)) {
1318
1429
  text-align: left;
@@ -1582,11 +1693,9 @@
1582
1693
  border-color: hsl(var(--input));
1583
1694
  }
1584
1695
  .ch-number-input-field-invalid {
1696
+ border-width: 2px;
1585
1697
  border-color: hsl(var(--destructive));
1586
1698
  }
1587
- .ch-number-input-field-invalid:focus-visible {
1588
- --tw-ring-color: hsl(var(--destructive));
1589
- }
1590
1699
  /* numberInputStepper */
1591
1700
  .ch-number-input-stepper {
1592
1701
  display: flex;
@@ -12,6 +12,14 @@
12
12
  "option": "secondary",
13
13
  "isDefault": false
14
14
  },
15
+ {
16
+ "recipe": "button",
17
+ "className": "ch-btn-promo",
18
+ "kind": "modifier",
19
+ "axis": "variant",
20
+ "option": "promo",
21
+ "isDefault": false
22
+ },
15
23
  {
16
24
  "recipe": "button",
17
25
  "className": "ch-btn-destructive",
@@ -91,18 +99,74 @@
91
99
  },
92
100
  {
93
101
  "recipe": "badge",
94
- "className": "ch-badge-destructive",
102
+ "className": "ch-badge-outline",
95
103
  "kind": "modifier",
96
104
  "axis": "variant",
97
- "option": "destructive",
105
+ "option": "outline",
98
106
  "isDefault": false
99
107
  },
100
108
  {
101
109
  "recipe": "badge",
102
- "className": "ch-badge-outline",
110
+ "className": "ch-badge-live",
103
111
  "kind": "modifier",
104
112
  "axis": "variant",
105
- "option": "outline",
113
+ "option": "live",
114
+ "isDefault": false
115
+ },
116
+ {
117
+ "recipe": "badge",
118
+ "className": "ch-badge-working",
119
+ "kind": "modifier",
120
+ "axis": "variant",
121
+ "option": "working",
122
+ "isDefault": false
123
+ },
124
+ {
125
+ "recipe": "badge",
126
+ "className": "ch-badge-off",
127
+ "kind": "modifier",
128
+ "axis": "variant",
129
+ "option": "off",
130
+ "isDefault": false
131
+ },
132
+ {
133
+ "recipe": "badge",
134
+ "className": "ch-badge-attention",
135
+ "kind": "modifier",
136
+ "axis": "variant",
137
+ "option": "attention",
138
+ "isDefault": false
139
+ },
140
+ {
141
+ "recipe": "badge",
142
+ "className": "ch-badge-critical",
143
+ "kind": "modifier",
144
+ "axis": "variant",
145
+ "option": "critical",
146
+ "isDefault": false
147
+ },
148
+ {
149
+ "recipe": "badge",
150
+ "className": "ch-badge-promo",
151
+ "kind": "modifier",
152
+ "axis": "variant",
153
+ "option": "promo",
154
+ "isDefault": false
155
+ },
156
+ {
157
+ "recipe": "badge",
158
+ "className": "ch-badge-count",
159
+ "kind": "modifier",
160
+ "axis": "variant",
161
+ "option": "count",
162
+ "isDefault": false
163
+ },
164
+ {
165
+ "recipe": "badge",
166
+ "className": "ch-badge-quantity",
167
+ "kind": "modifier",
168
+ "axis": "variant",
169
+ "option": "quantity",
106
170
  "isDefault": false
107
171
  },
108
172
  {
@@ -113,6 +177,14 @@
113
177
  "option": "success",
114
178
  "isDefault": false
115
179
  },
180
+ {
181
+ "recipe": "badge",
182
+ "className": "ch-badge-info",
183
+ "kind": "modifier",
184
+ "axis": "variant",
185
+ "option": "info",
186
+ "isDefault": false
187
+ },
116
188
  {
117
189
  "recipe": "badge",
118
190
  "className": "ch-badge-warning",
@@ -123,10 +195,10 @@
123
195
  },
124
196
  {
125
197
  "recipe": "badge",
126
- "className": "ch-badge-info",
198
+ "className": "ch-badge-destructive",
127
199
  "kind": "modifier",
128
200
  "axis": "variant",
129
- "option": "info",
201
+ "option": "destructive",
130
202
  "isDefault": false
131
203
  },
132
204
  {
@@ -804,6 +876,14 @@
804
876
  "className": "ch-table-row",
805
877
  "kind": "block"
806
878
  },
879
+ {
880
+ "recipe": "tableRow",
881
+ "className": "ch-table-row-striped",
882
+ "kind": "modifier",
883
+ "axis": "striped",
884
+ "option": "true",
885
+ "isDefault": false
886
+ },
807
887
  {
808
888
  "recipe": "tableRow",
809
889
  "className": "ch-table-row-interactive",
@@ -18,8 +18,8 @@
18
18
  --color-gray-200: #e5e7eb;
19
19
  --color-gray-300: #d1d5db;
20
20
  --color-gray-400: #9ca3af;
21
- --color-gray-500: #7a7a7a;
22
- --color-gray-600: #4f4f4f;
21
+ --color-gray-500: #767574;
22
+ --color-gray-600: #50504f;
23
23
  --color-gray-700: #3d3d3d;
24
24
  --color-gray-800: #2a2a2a;
25
25
  --color-gray-900: #1a1a1a;
@@ -170,6 +170,20 @@
170
170
  --color-primary: hsl(var(--primary));
171
171
  --color-primary-foreground: hsl(var(--primary-foreground));
172
172
  --color-primary-hover: hsl(var(--primary-hover));
173
+ --color-primary-active: hsl(var(--primary-active));
174
+ --color-promo: hsl(var(--promo));
175
+ --color-promo-foreground: hsl(var(--promo-foreground));
176
+ --color-promo-hover: hsl(var(--promo-hover));
177
+ --color-live: hsl(var(--live));
178
+ --color-live-foreground: hsl(var(--live-foreground));
179
+ --color-nav-active: hsl(var(--nav-active));
180
+ --color-nav-active-foreground: hsl(var(--nav-active-foreground));
181
+ --color-nav-hover: hsl(var(--nav-hover));
182
+ --color-row-zebra: hsl(var(--row-zebra));
183
+ --color-row-hover: hsl(var(--row-hover));
184
+ --color-row-hover-zebra: hsl(var(--row-hover-zebra));
185
+ --color-row-selected: hsl(var(--row-selected));
186
+ --color-link: hsl(var(--link));
173
187
  --color-secondary: hsl(var(--secondary));
174
188
  --color-secondary-foreground: hsl(var(--secondary-foreground));
175
189
  --color-secondary-hover: hsl(var(--secondary-hover));
@@ -210,6 +224,33 @@
210
224
  --color-chart-3: hsl(var(--chart-3));
211
225
  --color-chart-4: hsl(var(--chart-4));
212
226
  --color-chart-5: hsl(var(--chart-5));
227
+ --color-ch-spark: #e02726;
228
+ --color-ch-white: #ffffff;
229
+ --color-ch-paper: #f2f2ee;
230
+ --color-ch-linen: #e1e2d8;
231
+ --color-ch-lichen: #c2c5b1;
232
+ --color-ch-sage-500: #969a82;
233
+ --color-ch-sage-600: #81856e;
234
+ --color-ch-sage-700: #6c705b;
235
+ --color-ch-sage-900: #2f3128;
236
+ --color-ch-grey-01: #50504f;
237
+ --color-ch-grey-02: #767574;
238
+ --color-ch-heritage-teal: #1b373b;
239
+ --color-ch-heritage-teal-lift: #2a4e53;
240
+ --color-ch-accent-teal: #34999c;
241
+ --color-ch-accent-teal-100: #d8eded;
242
+ --color-ch-founders-red: #ae2025;
243
+ --color-ch-founders-red-dark: #941b1f;
244
+ --color-ch-pikes-gold: #c9a66e;
245
+ --color-ch-collection-preamble: #4a8a6f;
246
+ --color-ch-collection-cadence: #2e5a4a;
247
+ --color-ch-collection-portrait: #6a5280;
248
+ --color-ch-collection-midtown: #1b2230;
249
+ --color-ch-collection-four-square: #7a5837;
250
+ --color-ch-collection-classic: #2b4660;
251
+ --color-ch-reserved-tidewater: #3b7689;
252
+ --color-ch-reserved-currant: #7d4560;
253
+ --color-ch-reserved-dusk: #767fa5;
213
254
  --color-brand-red-logo: var(--color-red-logo);
214
255
  --color-brand-red-primary: var(--color-red-primary);
215
256
  --color-brand-grey-1: var(--color-grey-1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@classic-homes/theme-styles",
3
- "version": "0.10.0",
3
+ "version": "0.13.0",
4
4
  "description": "Base styles and utilities for the Classic Theme design system",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -15,6 +15,7 @@
15
15
  "./base": "./src/base.css",
16
16
  "./accessibility": "./src/accessibility.css",
17
17
  "./utilities": "./src/utilities.css",
18
+ "./fold": "./src/fold.css",
18
19
  "./tailwind-v4": "./dist/tailwind-v4.css",
19
20
  "./tailwind-v4.css": "./dist/tailwind-v4.css",
20
21
  "./components.css": "./dist/components.css",
package/src/base.css CHANGED
@@ -41,7 +41,7 @@
41
41
  min-height: 100vh;
42
42
  }
43
43
 
44
- /* Headings: h1 is the display face (Spectral 500 italic); h2-h6 are Figtree 600 */
44
+ /* Headings: h1 is the display face (Spectral 400 upright); h2-h6 are Figtree 600 */
45
45
  h1,
46
46
  h2,
47
47
  h3,
@@ -64,8 +64,7 @@
64
64
  Times,
65
65
  serif
66
66
  );
67
- font-weight: 500;
68
- font-style: italic;
67
+ font-weight: 400;
69
68
  font-size: 2.5rem; /* 40px */
70
69
  line-height: 2.75rem; /* 2rem overlapped wrapped lines */
71
70
  }
@@ -120,8 +119,9 @@
120
119
 
121
120
  /* Links */
122
121
  a {
123
- color: hsl(var(--primary));
122
+ color: hsl(var(--link));
124
123
  text-decoration: none;
124
+ text-underline-offset: 4px;
125
125
  /* No color transition: interpolating between base and hover colors renders
126
126
  off-palette intermediate frames that read as flicker when sweeping across
127
127
  adjacent links (menus, sidebars, lists). Hover color changes must snap. */
@@ -130,6 +130,12 @@
130
130
  a:hover {
131
131
  text-decoration: underline;
132
132
  }
133
+ /* Body links (bare <a> from markdown or hand-written content) are always
134
+ underlined, so they are not shown by colour alone. Styled links (nav,
135
+ buttons, cards) carry a class and keep their own decoration. */
136
+ a:not([class]) {
137
+ text-decoration: underline;
138
+ }
133
139
 
134
140
  /* Strong text */
135
141
  strong,
@@ -208,7 +214,7 @@
208
214
 
209
215
  th {
210
216
  font-weight: 600;
211
- background-color: hsl(var(--muted));
217
+ background-color: hsl(var(--accent)); /* Linen */
212
218
  }
213
219
 
214
220
  /* Form element resets */
package/src/core.css CHANGED
@@ -24,3 +24,6 @@
24
24
 
25
25
  /* Import utility classes */
26
26
  @import './utilities.css';
27
+
28
+ /* Keep content out of a foldable's fold (only while data-fold is set) */
29
+ @import './fold.css';
package/src/fold.css ADDED
@@ -0,0 +1,97 @@
1
+ /**
2
+ * Classic Theme Fold Styles
3
+ *
4
+ * Keeps content and controls out of the fold of a foldable phone (iPhone Duo)
5
+ * while it is partly open. WebKit tells a page nothing about the fold, so the
6
+ * Classic Theme iOS shell (see @classic-homes/native, "Foldable") sets, on
7
+ * <html>:
8
+ *
9
+ * data-fold="vertical" the fold runs top to bottom: two panes side by side
10
+ * data-fold="horizontal" the fold runs left to right: a top and a bottom pane
11
+ * data-fold="none" no active fold (closed, or fully open)
12
+ *
13
+ * and --fold-left/-top/-width/-height in CSS px of the layout viewport. Every
14
+ * rule here needs data-fold="vertical" or "horizontal", so nothing changes in a
15
+ * browser, on Android, on the desktop, closed or fully open (Apple: avoid
16
+ * extreme layout changes; fully open, content may cross the fold).
17
+ *
18
+ * Unlayered on purpose: while the device is folded these rules must win over
19
+ * the page's own Tailwind display, padding and gap utilities.
20
+ *
21
+ * - The header's mobile menu (Header `mobileNav`) stays in one pane.
22
+ * - The main content region of a full-width layout (PublicLayout) is centred
23
+ * on the fold, and its two-column grids widen their gap to cover it, so the
24
+ * gap of an even column count lands on the fold. `.fold-center` does the
25
+ * same for any other full-width element.
26
+ * - `.fold-split` lays out its first two children one per pane.
27
+ */
28
+
29
+ /* ===== Header mobile menu: one pane ===== */
30
+
31
+ html[data-fold='vertical'] header > nav[aria-label='Mobile navigation'] {
32
+ max-width: var(--fold-left, 100%);
33
+ border-inline-end: 1px solid hsl(var(--foreground));
34
+ }
35
+
36
+ html[data-fold='horizontal'] header > nav[aria-label='Mobile navigation'] {
37
+ /* Below the 4rem bar (plus its top inset), above the fold */
38
+ max-height: calc(var(--fold-top, 100vh) - 4rem - env(safe-area-inset-top, 0px));
39
+ overflow-y: auto;
40
+ overscroll-behavior: contain;
41
+ }
42
+
43
+ /* ===== Full-width content centred on the fold ===== */
44
+
45
+ /* A layout's main region spans the viewport unless a sidebar precedes it
46
+ (DashboardLayout), whose offset CSS cannot know: that one is left alone.
47
+ Widths are 100% of the containing block (the layout viewport), never 100vw:
48
+ in the iOS app 100vw is the whole web view, content inset included. */
49
+ html[data-fold='vertical'] :is(.fold-center, main#main-content:not(aside ~ * main)) {
50
+ --fold-center: calc(var(--fold-left, 50%) + var(--fold-width, 0px) / 2);
51
+ --fold-half: min(var(--fold-center), 100% - var(--fold-center));
52
+ /* The larger of the safe-area inset and what centres the content box */
53
+ padding-inline-start: max(env(safe-area-inset-left, 0px), var(--fold-center) - var(--fold-half));
54
+ padding-inline-end: max(
55
+ env(safe-area-inset-right, 0px),
56
+ 100% - var(--fold-center) - var(--fold-half)
57
+ );
58
+ }
59
+
60
+ html[data-fold='vertical']
61
+ :is(.fold-center, main#main-content:not(aside ~ * main))
62
+ :is([class*='grid-cols-2'], .fold-gap) {
63
+ column-gap: max(1.5rem, var(--fold-width, 0px));
64
+ }
65
+
66
+ /* ===== One pane per segment ===== */
67
+
68
+ /* For an element that starts at the viewport's left (vertical fold) or top
69
+ (horizontal fold) edge, such as a fixed full-screen view. Without an active
70
+ fold it keeps whatever layout the page gave it. */
71
+ html[data-fold='vertical'] .fold-split {
72
+ display: grid;
73
+ grid-template-columns: var(--fold-left) var(--fold-width) minmax(0, 1fr);
74
+ grid-template-rows: minmax(0, 1fr);
75
+ }
76
+
77
+ html[data-fold='vertical'] .fold-split > :nth-child(1) {
78
+ grid-area: 1 / 1;
79
+ }
80
+
81
+ html[data-fold='vertical'] .fold-split > :nth-child(2) {
82
+ grid-area: 1 / 3;
83
+ }
84
+
85
+ html[data-fold='horizontal'] .fold-split {
86
+ display: grid;
87
+ grid-template-rows: var(--fold-top) var(--fold-height) minmax(0, 1fr);
88
+ grid-template-columns: minmax(0, 1fr);
89
+ }
90
+
91
+ html[data-fold='horizontal'] .fold-split > :nth-child(1) {
92
+ grid-area: 1 / 1;
93
+ }
94
+
95
+ html[data-fold='horizontal'] .fold-split > :nth-child(2) {
96
+ grid-area: 3 / 1;
97
+ }
package/src/index.css CHANGED
@@ -30,3 +30,6 @@
30
30
 
31
31
  /* Import utility classes */
32
32
  @import './utilities.css';
33
+
34
+ /* Keep content out of a foldable's fold (only while data-fold is set) */
35
+ @import './fold.css';
package/src/utilities.css CHANGED
@@ -6,6 +6,21 @@
6
6
  */
7
7
 
8
8
  @layer classic-theme.utilities {
9
+ /* Focus on dark fields (Heritage Teal header, toolbar, collection heroes):
10
+ the teal ring disappears there, so use a White ring with a teal halo. */
11
+ .focus-ring-inverse:focus-visible {
12
+ outline: 3px solid #ffffff;
13
+ outline-offset: 2px;
14
+ box-shadow: 0 0 0 5px hsl(var(--primary));
15
+ }
16
+
17
+ /* Collection components keep local links and controls neutral (v2.5):
18
+ Grey 01 links and focus instead of Heritage Teal. */
19
+ .collection-component {
20
+ --link: var(--foreground);
21
+ --ring: var(--foreground);
22
+ }
23
+
9
24
  /* ===== Scrollbar Utilities ===== */
10
25
 
11
26
  /* Hide scrollbar but keep functionality */