@getvitops/core 2.0.0 → 3.0.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/CHANGELOG.md CHANGED
@@ -1,5 +1,187 @@
1
1
  # @getvitops/core
2
2
 
3
+ ## 3.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - 6e68ace: **Breaking:** the site config is now a three-section `Config` — `designSystem`,
8
+ `organization`, `site`.
9
+
10
+ The flat `SiteConfig` held the company (`organization`, `contact`, `locations`) and the
11
+ deployment (`analytics`, `environments`, `seo`, `legal`) as peers, so no single noun
12
+ described it, and a second site sharing the same company had no way to say so. The three
13
+ sections split those apart: several sites can now carry one `organization` and differ only
14
+ in `site`.
15
+
16
+ **Migrating.** `designSystem` stays at the root, and the fields already under
17
+ `organization` stay where they are. Everything else moves into one of two sections:
18
+ - → `site`: `defaultLocale`, `locales`, `domains`, `dns`, `cloudflare`, `environments`,
19
+ `abTesting`, `fonts`, `tags`, `postTypes`, `galleries`, `testimonials`, `templates`,
20
+ `navigation`, `seo`, `analytics`, `notifications`, `tracking`, `security`, `legal`,
21
+ `icons`, `favicon`, `deployment`
22
+ - → `organization`: `contact`, `primaryLocation`, `locations`, `services`, `links`
23
+
24
+ You do not have to work this out from the list: `vitops validate` detects a pre-3.0 flat
25
+ config and prints every move by name, rather than reporting a dozen unknown keys.
26
+
27
+ ```jsonc
28
+ {
29
+ "designSystem": {
30
+ "themes": {
31
+ "default": {
32
+ /* … */
33
+ },
34
+ },
35
+ },
36
+ "organization": {
37
+ "name": "Acme",
38
+ "contact": "hq",
39
+ "locations": {
40
+ "hq": {
41
+ /* … */
42
+ },
43
+ },
44
+ },
45
+ "site": {
46
+ "defaultLocale": "en",
47
+ "domains": {
48
+ /* … */
49
+ },
50
+ "analytics": {
51
+ /* … */
52
+ },
53
+ },
54
+ }
55
+ ```
56
+
57
+ **Renamed exports** (`@getvitops/generator`): `SiteConfigSchema` → `ConfigSchema`,
58
+ `SiteConfig` → `Config`, `validateSite` → `validateConfig`, `resolveSiteConfig` →
59
+ `resolveConfig`, `isSiteConfig` → `isConfig`, `siteJsonSchema` → `configJsonSchema`,
60
+ `SITE_SCHEMA_URL` → `CONFIG_SCHEMA_URL`, `SiteValidationResult` →
61
+ `ConfigValidationResult`. `ResolvedInput.site` is now `ResolvedInput.config`. New:
62
+ `OrganizationConfig` and `SiteSection` for the two sections.
63
+
64
+ **Renamed schema file:** `@getvitops/generator/site.schema.json` →
65
+ `@getvitops/generator/config.schema.json`. Update the `$schema` key in your config.
66
+
67
+ Option names are unchanged — `vitops({ site: { input } })`, the Vite plugin's `site`,
68
+ and `generate({ site })` still point at the config file.
69
+
70
+ **The Astro integration is now `vitops()`, not `getvitops()`.** It is a default export,
71
+ so the name is yours and nothing breaks on upgrade, but every example now reads
72
+ `import vitops from '@getvitops/astro'` — matching the Vite plugin, which has always been
73
+ `vitops`. The `@getvitops/*` package scope and the internal `virtual:getvitops/*` module
74
+ ids are unchanged; neither is an import name.
75
+
76
+ **Added:** a generated config authoring reference — `vitops docs config`, `docs/config.md`
77
+ in the OKF bundle, and _Config reference_ on the docs site. It is walked from the published
78
+ JSON Schema by the same helper that renders the `design-system.json` reference, so it
79
+ cannot describe a field validation does not accept.
80
+
81
+ - b115993: Nav shells, a top-layer animation driver, and a pile of fixes to things that never worked
82
+
83
+ ### Breaking
84
+ - **Two custom elements renamed.** `<copy-button>` → `<wc-copy>`, `<multi-field>` →
85
+ `<wc-multifield>`. Update your markup. The Bricks element keys
86
+ (`vitops-copy-button`, `vitops-multi-field`) are **unchanged**, so elements already
87
+ placed on a Bricks page keep working; so are the `--multi-field-*` custom properties
88
+ and the `multi-field-*` events.
89
+ - **`<details>` now animates open and closed** where `prefers-reduced-motion` allows.
90
+ It was previously instant by deliberate choice — the transition used to deadlock the
91
+ disclosure shut. Re-verified on Chrome 149 with a real click; both `block-size` and
92
+ `content-visibility` must stay in the transition list, and dropping the latter
93
+ reproduces the deadlock.
94
+ - **Drawers and dialogs now animate on close.** Both drove their entry with
95
+ `animation:` on `[open]`, which by construction plays once — so the close was
96
+ instant. They now use the top-layer driver and animate both ways.
97
+ - **`.rhythm` gives every non-heading block heading-spacing before a heading.** The
98
+ pairs used to enumerate `p` (later `p, pre, blockquote, table, dl, ul, ol`), so a
99
+ heading after anything else got paragraph spacing. They are now defined by what a
100
+ heading _is_ — `h1`–`h6` plus the `font-display` / `font-title` / `font-heading` type
101
+ roles — and inverted to `:not(<heading>) + <heading>`. Expect slightly more space
102
+ above headings that follow a code block, table, figure-like `<div>` or component.
103
+ - **`popover.css` no longer pins `[popover]:popover-open { opacity: 1 }`.** It never
104
+ animated anything on its own, but it outranked `.transition` and made every
105
+ top-layer fade impossible. Removing it is what lets the driver work.
106
+ - **`nav.css`'s `.drawer-menu` timing** now follows `--animation-duration` /
107
+ `--custom-ease-out` instead of hand-set 0.4s / 0.7s.
108
+
109
+ ### Fixed
110
+ - **`.sitenav--bp-sm` dropdowns could never open.** Its desktop block had drifted onto
111
+ an older markup shape, selecting `.sitenav__disclosure > .sitenav__submenu` where the
112
+ submenu is the disclosure's _sibling_. The four "intentionally parallel" breakpoint
113
+ blocks are now one shared block behind a style query — `md`/`lg`/`xl` were
114
+ byte-identical and only `sm` had rotted, which is exactly the drift the arrangement
115
+ invited. 583 → 361 lines.
116
+ - **Hover dropdowns rendered off-screen.** A closed popover is not in the top layer but
117
+ keeps the UA's `position: fixed`, and `.dropdown--show-on-hover` reset only `inset` —
118
+ so the panel faithfully faded in ~3300px from its trigger. Now anchored to it, and it
119
+ follows on scroll. Affects `.split-link--show-on-hover` too.
120
+ - **Horizontal overflow on narrow screens.** `.centered > *` floors at
121
+ `min-inline-size: 0`; `body` gets `overflow-wrap: break-word`; `patterns/code.css`
122
+ gains the `pre` rules it never had (`max-inline-size: 100%`, `overflow-x: auto`) and
123
+ gives inline `<code>` `overflow-wrap: anywhere`. Note a scroll container does _not_
124
+ zero its min-content contribution in Chrome, which is what made a single `<pre>` hold
125
+ a 390px viewport open at 797px.
126
+ - **`.split-<a>-<b>` now publishes `--_flex-direction: row`.** Only `.flex-*` did, so
127
+ `class="split flex-col md-split-1-2"` left the variable reading `column` at every
128
+ width and a nested `.grouped` collapsed its borders on the wrong axis.
129
+ - **`.toc-layout` uses `minmax(0, 1fr)`** instead of a bare `1fr`, whose automatic
130
+ minimum is min-content.
131
+
132
+ ### Added
133
+ - **`patterns/navshell.css` + `<NavShell>` / `<NavShellToggle>`** — a navigation aside
134
+ beside content at width, collapsing to a toggle and drawer below it. **It nests**: a
135
+ site nav wrapping an on-this-page nav, each promoting at its own breakpoint, via a
136
+ style query on an inherited flag rather than four copied blocks. Its content column
137
+ is a container, so an inner shell measures the space it actually has. The toggle can
138
+ live outside the shell (a site header) with `toggle="external"`.
139
+ - **`patterns/navbar.css`** — `.navbar` extracted from `nav.css`, where it was only
140
+ half of that file's drawer⇄navbar pair, plus `--start` / `--center` / `--end`,
141
+ `__spacer` and `--sticky` (old `.navbar-sticky` aliased).
142
+ - **A top-layer animation driver.** `animation.css` gained the fourth driver alongside
143
+ `animate-view` / `animate-scroll` / `animate-trigger` / `transition`, and every effect
144
+ gained an `open-<fx>` state variant. Overlays now state _where they start_
145
+ (`--translate-x-from`) instead of owning a keyframe: `class="drawer drawer--right
146
+ open-fade-in"` composes slide and fade. Applied at zero specificity with identity
147
+ defaults, so a popover that sets no effect vars is unchanged.
148
+ - **One scrim.** `--scrim` / `--scrim-filter` tokens and `.no-scrim` in `popover.css`,
149
+ replacing 18 `::backdrop` blocks across seven partials. `.drawer--modeless` is aliased.
150
+ - **`<wc-marquee>`** — clones the content enough times to cover the track, so every gap
151
+ matches including the seam. The CSS-only `.marquee` is unchanged and still works
152
+ without it; the element only makes the spacing right. `--marquee-gap` added.
153
+ - **`--width-nav`** joins `--width-measure` / `-breakout` / `-spotlight` as the nav
154
+ column width.
155
+ - **`.skip-link`** in `patterns/anchor-link.css`, using a clip rather than the
156
+ `-100vw` idiom (which overflows in RTL and ignores the scrollbar gutter).
157
+ - **`.table-wrapper`** documented as the scroll wrapper for wide tables.
158
+
159
+ ### Notes
160
+ - `patterns/nav.css` is marked legacy. Its header promised a Lit nav component that was
161
+ never written and is not planned — the house pattern is native. Use `navbar`,
162
+ `sitenav` or `navshell`; removal is a later change.
163
+ - `scroll-target.css`'s `.is-current` no longer claims to be a JS scroll-spy fallback.
164
+ There is no such code; `:target-current` is the only working highlight, which today
165
+ means Chrome.
166
+ - `elements.js` gains one element (`wc-marquee`), so the shared bundle is slightly
167
+ larger for every consumer.
168
+ - A registered custom property's `initial-value` must be computationally independent —
169
+ `16rem` is not, so `@property` silently drops the whole rule. `navshell` uses an
170
+ inline fallback instead.
171
+
172
+ ### Patch Changes
173
+
174
+ - Updated dependencies [6e68ace]
175
+ - @getvitops/utils@3.0.0
176
+
177
+ ## 2.1.0
178
+
179
+ ### Patch Changes
180
+
181
+ - Updated dependencies [20e518e]
182
+ - Updated dependencies [9bf975a]
183
+ - @getvitops/utils@2.1.0
184
+
3
185
  ## 2.0.0
4
186
 
5
187
  ### Major Changes
package/css/animation.css CHANGED
@@ -529,6 +529,85 @@
529
529
  }
530
530
  }
531
531
 
532
+ /* ===========================================
533
+ * Tier 1c: Top layer (popover / dialog open-close)
534
+ * The `open-<fx>` state variants (generated, like hover-/focus-/active-) already
535
+ * supply the VALUES. What a top-layer element additionally needs is mechanism,
536
+ * and that is the same for every effect — so it lives here, once:
537
+ *
538
+ * <div popover class="drawer drawer--start transition open-slide-right">
539
+ *
540
+ * Before this existed there was no driver for the top layer, so every overlay
541
+ * pattern hand-rolled one: drawer.css drove entry with four @keyframes and
542
+ * `animation:`, which only plays on OPEN (its close was instant), while
543
+ * sitenav.css used a transition and animated both ways. Same job, two
544
+ * mechanisms, two behaviours.
545
+ * =========================================== */
546
+
547
+ /* Applied to the top layer BY DEFAULT, and at `:where()` zero specificity.
548
+ *
549
+ * Not an opt-in class, unlike the other three drivers, for two reasons. It is
550
+ * free: every endpoint below defaults to identity (opacity 1, translate 0,
551
+ * scale 1), so a popover that sets no effect vars transitions between two
552
+ * identical states and looks exactly as it did before. And it preserves the DX
553
+ * the keyframes had — `.drawer--right` animated without asking the author for a
554
+ * driver class, and it still does; it just states its start as
555
+ * `--translate-x-from: 100%` instead of owning a keyframe.
556
+ *
557
+ * Zero specificity means any pattern that wants different motion simply
558
+ * declares it. */
559
+ :where([popover], dialog) {
560
+ opacity: var(--t-opacity, var(--opacity-from, 1));
561
+ translate: var(--t-translate-x, var(--translate-x-from, 0))
562
+ var(--t-translate-y, var(--translate-y-from, 0));
563
+ scale: var(--t-scale-x, var(--scale-x-from, 1)) var(--t-scale-y, var(--scale-y-from, 1));
564
+ rotate: var(--t-rotate, var(--rotate-from, 0deg));
565
+ clip-path: var(--t-clip, var(--clip-from, none));
566
+
567
+ /* `display` and `overlay` are discrete, and BOTH must transition or the
568
+ element is yanked out of the top layer the instant it closes — you get an
569
+ entry animation and no exit, which is exactly the asymmetry drawer.css had.
570
+ `allow-discrete` is what keeps it rendered for the duration. */
571
+ transition-property: opacity, translate, scale, rotate, clip-path, display, overlay;
572
+ transition-duration: var(--animation-duration);
573
+ transition-timing-function: var(--custom-ease-out);
574
+ transition-behavior: allow-discrete;
575
+ }
576
+
577
+ /* The open flip. Mirrors what the generated `open-<fx>` variants do, so the
578
+ common case needs no effect class at all; an explicit `open-<fx>` still wins
579
+ on specificity and can pick a different effect. */
580
+ :where([popover]:popover-open, dialog[open]) {
581
+ --t-opacity: var(--opacity-to, 1);
582
+ --t-translate-x: var(--translate-x-to, 0);
583
+ --t-translate-y: var(--translate-y-to, 0);
584
+ --t-scale-x: var(--scale-x-to, 1);
585
+ --t-scale-y: var(--scale-y-to, 1);
586
+ --t-rotate: var(--rotate-to, 0deg);
587
+ --t-clip: var(--clip-to, none);
588
+ }
589
+
590
+ /* The entry half. A closed popover is `display: none`, so it has no
591
+ before-change style and the open transition would simply not run —
592
+ @starting-style supplies one.
593
+ *
594
+ * It declares the PROPERTIES rather than resetting the `--t-*` custom
595
+ * properties, which sidesteps a specificity trap: the generated
596
+ * `.open-<fx>:popover-open` rules are (0,2,0), set `--t-*`, and are imported
597
+ * after this file, so a custom-property reset here would have to outrank them.
598
+ * Setting `opacity`/`translate`/… directly at (0,2,0) instead competes only with
599
+ * the (0,0,0) base rule above, which it beats regardless of what any effect
600
+ * class does. */
601
+ @starting-style {
602
+ :is([popover], dialog):is(:popover-open, [open]) {
603
+ opacity: var(--opacity-from, 1);
604
+ translate: var(--translate-x-from, 0) var(--translate-y-from, 0);
605
+ scale: var(--scale-x-from, 1) var(--scale-y-from, 1);
606
+ rotate: var(--rotate-from, 0deg);
607
+ clip-path: var(--clip-from, none);
608
+ }
609
+ }
610
+
532
611
  /* Respect reduced-motion: drop keyframes, transitions, and continuous floats so
533
612
  elements settle at their natural resolved state. Plain selectors + !important
534
613
  so this reliably overrides the driver/float rules (a legitimate a11y override). */
@@ -543,6 +622,17 @@
543
622
  .transition {
544
623
  transition: none !important;
545
624
  }
625
+ /* The top-layer driver is applied by default rather than by class, so it needs
626
+ naming here explicitly — `.transition` above does not cover it. `display`
627
+ and `overlay` must still change, they just must not be animated, and
628
+ `transition: none` is exactly that. */
629
+ [popover],
630
+ dialog {
631
+ transition: none !important;
632
+ }
633
+ :where([popover], dialog)::backdrop {
634
+ transition: none !important;
635
+ }
546
636
  }
547
637
 
548
638
  /* ===========================================
package/css/global.css CHANGED
@@ -32,6 +32,16 @@
32
32
  around them. */
33
33
  body {
34
34
  margin: 0;
35
+
36
+ /* Long unbreakable strings are the single most common source of horizontal
37
+ page scroll, and prose is full of them — URLs, file paths, CSS selectors.
38
+ `break-word` rather than `anywhere` on purpose: it only takes effect when a
39
+ word would otherwise overflow, and it does NOT contribute to min-content
40
+ sizing, so no existing layout's intrinsic measurements move. (`anywhere`
41
+ does affect min-content, which would silently resize every intrinsically
42
+ sized box in a consumer's site.) Inline <code> gets the stronger `anywhere`
43
+ in patterns/code.css, where a break mid-token is the correct trade. */
44
+ overflow-wrap: break-word;
35
45
  }
36
46
 
37
47
  @media (prefers-reduced-motion: no-preference) {
package/css/index.css CHANGED
@@ -33,7 +33,12 @@
33
33
  @import './patterns/tooltip.css';
34
34
  @import './patterns/dropdown.css';
35
35
  @import './patterns/split-link.css';
36
+ /* navbar before sitenav: sitenav's wide state composes it. */
37
+ @import './patterns/navbar.css';
36
38
  @import './patterns/sitenav.css';
39
+ /* After sitenav (the nav family stays contiguous) and after drawer.css, whose
40
+ panel surface navshell's desktop block has to undo. */
41
+ @import './patterns/navshell.css';
37
42
  @import './patterns/notification.css';
38
43
  @import './patterns/lightbox.css';
39
44
  @import './patterns/overlay.css';
@@ -156,43 +156,57 @@
156
156
  grid-column: fullbleed;
157
157
  }
158
158
  }
159
+ /* Every ratio publishes `--_flex-direction` alongside `flex-direction`. Only the
160
+ `.flex-*` utilities used to do that, so `class="split flex-col md-split-1-2"`
161
+ left the variable reading `column` at ALL widths — and patterns/grouped.css
162
+ resolves its collapsed-border axis from a `@container style(--_flex-direction:
163
+ column)` query, so a `.grouped` inside a re-rowed split collapsed on the wrong
164
+ axis with nothing to indicate why. */
159
165
  .split-1-2 {
160
166
  flex-direction: row;
167
+ --_flex-direction: row;
161
168
  --_split-a: 1;
162
169
  --_split-b: 2;
163
170
  }
164
171
  .split-2-1 {
165
172
  flex-direction: row;
173
+ --_flex-direction: row;
166
174
  --_split-a: 2;
167
175
  --_split-b: 1;
168
176
  }
169
177
  .split-1-3 {
170
178
  flex-direction: row;
179
+ --_flex-direction: row;
171
180
  --_split-a: 1;
172
181
  --_split-b: 3;
173
182
  }
174
183
  .split-3-1 {
175
184
  flex-direction: row;
185
+ --_flex-direction: row;
176
186
  --_split-a: 3;
177
187
  --_split-b: 1;
178
188
  }
179
189
  .split-1-4 {
180
190
  flex-direction: row;
191
+ --_flex-direction: row;
181
192
  --_split-a: 1;
182
193
  --_split-b: 4;
183
194
  }
184
195
  .split-4-1 {
185
196
  flex-direction: row;
197
+ --_flex-direction: row;
186
198
  --_split-a: 4;
187
199
  --_split-b: 1;
188
200
  }
189
201
  .split-2-3 {
190
202
  flex-direction: row;
203
+ --_flex-direction: row;
191
204
  --_split-a: 2;
192
205
  --_split-b: 3;
193
206
  }
194
207
  .split-3-2 {
195
208
  flex-direction: row;
209
+ --_flex-direction: row;
196
210
  --_split-a: 3;
197
211
  --_split-b: 2;
198
212
  }
@@ -393,41 +407,49 @@
393
407
  @container (min-width: 30rem) {
394
408
  .sm-split-1-2 {
395
409
  flex-direction: row;
410
+ --_flex-direction: row;
396
411
  --_split-a: 1;
397
412
  --_split-b: 2;
398
413
  }
399
414
  .sm-split-2-1 {
400
415
  flex-direction: row;
416
+ --_flex-direction: row;
401
417
  --_split-a: 2;
402
418
  --_split-b: 1;
403
419
  }
404
420
  .sm-split-1-3 {
405
421
  flex-direction: row;
422
+ --_flex-direction: row;
406
423
  --_split-a: 1;
407
424
  --_split-b: 3;
408
425
  }
409
426
  .sm-split-3-1 {
410
427
  flex-direction: row;
428
+ --_flex-direction: row;
411
429
  --_split-a: 3;
412
430
  --_split-b: 1;
413
431
  }
414
432
  .sm-split-1-4 {
415
433
  flex-direction: row;
434
+ --_flex-direction: row;
416
435
  --_split-a: 1;
417
436
  --_split-b: 4;
418
437
  }
419
438
  .sm-split-4-1 {
420
439
  flex-direction: row;
440
+ --_flex-direction: row;
421
441
  --_split-a: 4;
422
442
  --_split-b: 1;
423
443
  }
424
444
  .sm-split-2-3 {
425
445
  flex-direction: row;
446
+ --_flex-direction: row;
426
447
  --_split-a: 2;
427
448
  --_split-b: 3;
428
449
  }
429
450
  .sm-split-3-2 {
430
451
  flex-direction: row;
452
+ --_flex-direction: row;
431
453
  --_split-a: 3;
432
454
  --_split-b: 2;
433
455
  }
@@ -441,41 +463,49 @@
441
463
  @container (min-width: 48rem) {
442
464
  .md-split-1-2 {
443
465
  flex-direction: row;
466
+ --_flex-direction: row;
444
467
  --_split-a: 1;
445
468
  --_split-b: 2;
446
469
  }
447
470
  .md-split-2-1 {
448
471
  flex-direction: row;
472
+ --_flex-direction: row;
449
473
  --_split-a: 2;
450
474
  --_split-b: 1;
451
475
  }
452
476
  .md-split-1-3 {
453
477
  flex-direction: row;
478
+ --_flex-direction: row;
454
479
  --_split-a: 1;
455
480
  --_split-b: 3;
456
481
  }
457
482
  .md-split-3-1 {
458
483
  flex-direction: row;
484
+ --_flex-direction: row;
459
485
  --_split-a: 3;
460
486
  --_split-b: 1;
461
487
  }
462
488
  .md-split-1-4 {
463
489
  flex-direction: row;
490
+ --_flex-direction: row;
464
491
  --_split-a: 1;
465
492
  --_split-b: 4;
466
493
  }
467
494
  .md-split-4-1 {
468
495
  flex-direction: row;
496
+ --_flex-direction: row;
469
497
  --_split-a: 4;
470
498
  --_split-b: 1;
471
499
  }
472
500
  .md-split-2-3 {
473
501
  flex-direction: row;
502
+ --_flex-direction: row;
474
503
  --_split-a: 2;
475
504
  --_split-b: 3;
476
505
  }
477
506
  .md-split-3-2 {
478
507
  flex-direction: row;
508
+ --_flex-direction: row;
479
509
  --_split-a: 3;
480
510
  --_split-b: 2;
481
511
  }
@@ -489,41 +519,49 @@
489
519
  @container (min-width: 64rem) {
490
520
  .lg-split-1-2 {
491
521
  flex-direction: row;
522
+ --_flex-direction: row;
492
523
  --_split-a: 1;
493
524
  --_split-b: 2;
494
525
  }
495
526
  .lg-split-2-1 {
496
527
  flex-direction: row;
528
+ --_flex-direction: row;
497
529
  --_split-a: 2;
498
530
  --_split-b: 1;
499
531
  }
500
532
  .lg-split-1-3 {
501
533
  flex-direction: row;
534
+ --_flex-direction: row;
502
535
  --_split-a: 1;
503
536
  --_split-b: 3;
504
537
  }
505
538
  .lg-split-3-1 {
506
539
  flex-direction: row;
540
+ --_flex-direction: row;
507
541
  --_split-a: 3;
508
542
  --_split-b: 1;
509
543
  }
510
544
  .lg-split-1-4 {
511
545
  flex-direction: row;
546
+ --_flex-direction: row;
512
547
  --_split-a: 1;
513
548
  --_split-b: 4;
514
549
  }
515
550
  .lg-split-4-1 {
516
551
  flex-direction: row;
552
+ --_flex-direction: row;
517
553
  --_split-a: 4;
518
554
  --_split-b: 1;
519
555
  }
520
556
  .lg-split-2-3 {
521
557
  flex-direction: row;
558
+ --_flex-direction: row;
522
559
  --_split-a: 2;
523
560
  --_split-b: 3;
524
561
  }
525
562
  .lg-split-3-2 {
526
563
  flex-direction: row;
564
+ --_flex-direction: row;
527
565
  --_split-a: 3;
528
566
  --_split-b: 2;
529
567
  }
@@ -537,41 +575,49 @@
537
575
  @container (min-width: 80rem) {
538
576
  .xl-split-1-2 {
539
577
  flex-direction: row;
578
+ --_flex-direction: row;
540
579
  --_split-a: 1;
541
580
  --_split-b: 2;
542
581
  }
543
582
  .xl-split-2-1 {
544
583
  flex-direction: row;
584
+ --_flex-direction: row;
545
585
  --_split-a: 2;
546
586
  --_split-b: 1;
547
587
  }
548
588
  .xl-split-1-3 {
549
589
  flex-direction: row;
590
+ --_flex-direction: row;
550
591
  --_split-a: 1;
551
592
  --_split-b: 3;
552
593
  }
553
594
  .xl-split-3-1 {
554
595
  flex-direction: row;
596
+ --_flex-direction: row;
555
597
  --_split-a: 3;
556
598
  --_split-b: 1;
557
599
  }
558
600
  .xl-split-1-4 {
559
601
  flex-direction: row;
602
+ --_flex-direction: row;
560
603
  --_split-a: 1;
561
604
  --_split-b: 4;
562
605
  }
563
606
  .xl-split-4-1 {
564
607
  flex-direction: row;
608
+ --_flex-direction: row;
565
609
  --_split-a: 4;
566
610
  --_split-b: 1;
567
611
  }
568
612
  .xl-split-2-3 {
569
613
  flex-direction: row;
614
+ --_flex-direction: row;
570
615
  --_split-a: 2;
571
616
  --_split-b: 3;
572
617
  }
573
618
  .xl-split-3-2 {
574
619
  flex-direction: row;
620
+ --_flex-direction: row;
575
621
  --_split-a: 3;
576
622
  --_split-b: 2;
577
623
  }
package/css/layout.css CHANGED
@@ -46,10 +46,82 @@
46
46
  .rhythm > * + * {
47
47
  margin-top: calc(var(--rhythm-base) * var(--rhythm-p-p));
48
48
  }
49
- .rhythm > :where(h1, h2, h3, h4, h5, h6) + p {
49
+ /* The heading pairs are defined by what a heading IS, not by a list of what can
50
+ sit next to one.
51
+ These used to enumerate the other side (`p`, then `p, pre, blockquote, table,
52
+ dl, ul, ol`), and an enumeration is a list that is always one element short:
53
+ first a `<pre>` got paragraph-to-paragraph spacing before a heading, then a
54
+ `<div class="marquee">` did. Any block is content; only headings are special.
55
+ So the rules invert — `:not(<heading>) + <heading>` — and nothing has to be
56
+ added here again.
57
+
58
+ `:where()` keeps the whole selector at (0,1,0), the same weight as the generic
59
+ `* + *` above, so SOURCE ORDER is what makes these win. Keep them below it,
60
+ and keep the media pairs below these — `figure + h2` matches both, and the
61
+ media rule is meant to take it.
62
+
63
+ A heading is also a TYPE ROLE, not just a tag: this framework's own idiom is
64
+ `<p class="font-heading">` inside a card, which is a heading in every sense
65
+ that matters to rhythm.
66
+
67
+ Those three are matched with `[class~="…"]`, not `.font-heading`, and the
68
+ difference is not cosmetic. `LAYER_CONTRACT` asserts that a utility's class
69
+ name appears first in `vitops.utilities`; writing `.font-display` here — in a
70
+ partial that lands in `vitops.components` — reads to that guard exactly like a
71
+ utility defined in the wrong layer, and it fails the build. The attribute form
72
+ says what is true: this rule REFERENCES the class, it does not define it. */
73
+ .rhythm
74
+ > :where(
75
+ h1,
76
+ h2,
77
+ h3,
78
+ h4,
79
+ h5,
80
+ h6,
81
+ [class~='font-display'],
82
+ [class~='font-title'],
83
+ [class~='font-heading']
84
+ )
85
+ + :not(
86
+ :where(
87
+ h1,
88
+ h2,
89
+ h3,
90
+ h4,
91
+ h5,
92
+ h6,
93
+ [class~='font-display'],
94
+ [class~='font-title'],
95
+ [class~='font-heading']
96
+ )
97
+ ) {
50
98
  margin-top: calc(var(--rhythm-base) * var(--rhythm-h-p));
51
99
  }
52
- .rhythm > p + :where(h1, h2, h3, h4, h5, h6) {
100
+ .rhythm
101
+ > :not(
102
+ :where(
103
+ h1,
104
+ h2,
105
+ h3,
106
+ h4,
107
+ h5,
108
+ h6,
109
+ [class~='font-display'],
110
+ [class~='font-title'],
111
+ [class~='font-heading']
112
+ )
113
+ )
114
+ + :where(
115
+ h1,
116
+ h2,
117
+ h3,
118
+ h4,
119
+ h5,
120
+ h6,
121
+ [class~='font-display'],
122
+ [class~='font-title'],
123
+ [class~='font-heading']
124
+ ) {
53
125
  margin-top: calc(var(--rhythm-base) * var(--rhythm-p-h));
54
126
  }
55
127
  .rhythm > :where(h1, h2, h3, h4, h5, h6) + :where(h1, h2, h3, h4, h5, h6) {
@@ -81,6 +153,11 @@
81
153
  --width-measure: 65ch;
82
154
  --width-breakout: 90ch;
83
155
  --width-spotlight: 120ch;
156
+ /* A navigation column beside content (`navshell`). In `rem`, not `ch`, unlike
157
+ the three above: those are reading measures and scale with the text they
158
+ hold, while a nav column is chrome sized in the page's own rhythm — it
159
+ should not get wider because the prose font has a wide `0` glyph. */
160
+ --width-nav: 16rem;
84
161
  --gutter: clamp(1rem, 4cqi, 3rem);
85
162
  }
86
163
 
@@ -110,6 +187,14 @@ body {
110
187
 
111
188
  .centered > * {
112
189
  grid-column: measure;
190
+ /* A grid item's automatic minimum size is its MIN-CONTENT size, and every
191
+ track here is definite (`--_measure` is a min() of two lengths; the rest are
192
+ minmax(0, …)). So a track child holding something with a large min-content —
193
+ a wide <pre>, a long unbreakable token — pushes past its track and the whole
194
+ document scrolls sideways. This caps the container; wrapping or scrolling
195
+ the CONTENT (see global.css and patterns/code.css) is what stops the visual
196
+ overflow. */
197
+ min-inline-size: 0;
113
198
  }
114
199
 
115
200
  /* Vertical rhythm region (usually on the Section) */