@stnd/styles 0.5.2 → 0.5.4

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,17 @@
1
1
  # @stnd/styles
2
2
 
3
+ ## 0.5.4
4
+
5
+ ### Patch Changes
6
+
7
+ - Auto-bumped @stnd/styles due to modified code.
8
+
9
+ ## 0.5.3
10
+
11
+ ### Patch Changes
12
+
13
+ - Auto-bumped @stnd/styles due to modified code.
14
+
3
15
  ## 0.5.2
4
16
 
5
17
  ### Patch Changes
package/README.md CHANGED
@@ -2,21 +2,24 @@
2
2
  title: "@stnd/styles"
3
3
  aliases: []
4
4
  created: 2026-07-04 23:27
5
- modified: 2026-07-05 19:16
5
+ modified: 2026-09-16T18:33:44.496Z
6
6
  last_audited: 2026-07-14
7
7
  audit_interval_days: 90
8
8
  next_audit: 2026-10-12
9
9
  audit_priority: 3
10
10
  maturity: tree
11
11
  mode: read
12
- publish: false
12
+ publish: true
13
13
  status: active
14
14
  tags:
15
15
  - package
16
16
  - stnd
17
17
  theme: kernel
18
18
  type: package
19
- visibility: private
19
+ visibility: public
20
+ garden-url: https://standard.garden/@francis/readme
21
+ garden-short: https://stnd.gd/Yl18ps
22
+ permalink: readme
20
23
  ---
21
24
 
22
25
  # @[stnd](../README)/styles
@@ -131,7 +134,7 @@ File-by-file pass, adding WHY-comments and checking for cascade/scope bugs. Fixe
131
134
  - **`$stnd-scope: ":root, body"` silently blocked frontmatter overrides.**
132
135
  A token declared on both `:root` and `body` always resolves to `body`'s own copy for anything read by a non-inherited property at-or-below `<body>` (its own `max-width`/`padding`) — inheritance never kicks in because `body` already has an explicit declaration. Any `:root`-only override (exactly what a note's frontmatter `inlineStyle` produces) was silently ineffective for `--body-max-width`, `--line-width`, `--gap-body`/`--gap-header`/`--gap-footer`. Root cause fixed at the scope itself (`$stnd-scope` → `:root`-only) rather than patched per-token. Caught via a live production repro on francisfontaine.com.
133
136
  - **`$stnd-scope` vs `$stnd-theme-scope`** — two SCSS variables, always set
134
- to the identical selector in every build config (`:root` on web, `body.stnd-theme` in Obsidian) since the fix above. Pure redundancy — consolidated to one (`$stnd-theme-scope`, the more widely-used name).
137
+ to the identical selector in every build config (`:root` on web, `body.stnd-adapter` in Obsidian) since the fix above. Pure redundancy — consolidated to one (`$stnd-theme-scope`, the more widely-used name).
135
138
  - **`$elements-boxed`** (`_standard-00-variables.scss`) — defined, never
136
139
  consumed anywhere. Deleted.
137
140
  - **Duplicate `--ease-aggressive`** — identical value declared twice in
@@ -139,7 +142,7 @@ File-by-file pass, adding WHY-comments and checking for cascade/scope bugs. Fixe
139
142
  - **`$mobile` docblock drift** — comment claimed `480px`, actual value is
140
143
  `600px` (confirmed correct). Comment fixed to match code.
141
144
  - **`obsidian.scss` docblock drift** — claimed tokens live "inside :root";
142
- actually scoped to `body.stnd-theme` (deliberately, for namespacing in Obsidian's shared window). Comment corrected.
145
+ actually scoped to `body.stnd-adapter` (deliberately, for namespacing in Obsidian's shared window). Comment corrected.
143
146
  - **`body`'s own dead `--max-width` fallback** (`_standard-07-base.scss`)
144
147
  — `max-width: var(--body-max-width, var(--max-width))`, left over from *my own* `--max-width` removal earlier this session (missed this one file at the time). `--body-max-width` always has a value, so the fallback never fired — harmless, but stale. Now matches `.prose`'s equivalent rule (`var(--body-max-width)`, no fallback).
145
148
  - **Garbled leftover comment** (`_standard-07-base.scss`) — a `[id]`
package/TOKENS.md CHANGED
@@ -1,13 +1,16 @@
1
1
  ---
2
2
  aliases: []
3
3
  created: 2026-03-16 08:07
4
- modified: 2026-07-03 16:26
4
+ modified: 2026-09-16T18:33:41.605Z
5
5
  mode: read
6
- publish: false
6
+ publish: true
7
7
  tags: []
8
- theme:
8
+ theme:
9
9
  type: note
10
- visibility: private
10
+ visibility: public
11
+ garden-url: https://standard.garden/@francis/tokens
12
+ permalink: tokens
13
+ garden-short: https://stnd.gd/jb29Tu
11
14
  ---
12
15
 
13
16
  # Standard Design Tokens
@@ -105,6 +108,7 @@ token — they break out by a fixed rhythm increment off `--line-width`
105
108
  | Token | Default | Description |
106
109
  | ------------------- | --------------------------------- | --------------------------------------------- |
107
110
  | `--body-max-width` | `900px` | The whole page shell — header, footer, content, and the ceiling `.hero`/`.full` grow into |
111
+ | `--body-max-width` | `900px` | The whole page shell — header, footer, content, and the ceiling `.hero`/`.full` grow into |
108
112
  | `--line-width-xs` | `24rem` | Extra small |
109
113
  | `--line-width-sm` | `32rem` | Small |
110
114
  | `--line-width-md` | `42rem` | Medium (default reading width) |
@@ -336,8 +340,8 @@ box-shadow: var(--shadow-inset), var(--shadow-ambient);
336
340
 
337
341
  | Token | Default | Description |
338
342
  | ---------------------- | ------------------------------- | ------------------ |
339
- | `--tooltip-background` | `#1a1a1a` | Tooltip background |
340
- | `--tooltip-text` | `#ffffff` | Tooltip text |
343
+ | `--tooltip-background` | `var(--color-dark, #1a1a1a)` | Tooltip background |
344
+ | `--tooltip-text` | `var(--color-light, #ffffff)` | Tooltip text |
341
345
  | `--tooltip-ease` | `cubic-bezier(0.25, 1, 0.5, 1)` | Tooltip animation |
342
346
 
343
347
  ---
@@ -1,3 +1,21 @@
1
+ /**
2
+ * @component Reset
3
+ * @category Foundation
4
+ * @description A deliberately narrow reset — no classes, nothing to apply.
5
+ * Box-sizing and thin scrollbars go on everything; margin/padding zeroing
6
+ * is scoped via `:where()` to standard typographic and layout elements
7
+ * only, so embedded editors (CodeMirror, Obsidian) and third-party widgets
8
+ * keep their native spacing instead of losing it to a blanket reset. List
9
+ * markers are removed, media elements become block-level and responsive by
10
+ * @property * Universal box-sizing (`border-box`), zero default border width, and thin scrollbars.
11
+ * @property :where(...) Targeted margin/padding zeroing on standard typographic and layout elements, protecting embedded editors.
12
+ * @property ol,ul,menu List-style unsetting for clean typographic lists.
13
+ * @property img,video Block display, vertical centering, and responsive max-width.
14
+ * @property svg Inline-block display for inline icons and symbols.
15
+ * @property [hidden] Defensive display hiding while preserving `hidden="until-found"` for find-in-page.
16
+ * @property script Enforced `display: none !important` guarding against aggressive global style overrides.
17
+ */
18
+
1
19
  /* =========================== */
2
20
  /* RESET */
3
21
  /* =========================== */
@@ -5,20 +5,27 @@
5
5
  * vertical rhythm and spacing across all elements. These mixins ensure proper
6
6
  * spacing application for rhythm-aware components.
7
7
  *
8
- * @prop {variable} $mobile Mobile breakpoint (600px)
9
- * @prop {variable} $small Small screen breakpoint (768px)
10
- * @prop {variable} $large Large screen breakpoint (1024px)
11
- * @prop {variable} $wide Wide screen breakpoint (1440px)
8
+ * @property $mobile Mobile breakpoint boundary (600px).
9
+ * @property $small Small screen/tablet breakpoint boundary (768px).
10
+ * @property $large Large desktop screen breakpoint boundary (1024px).
11
+ * @property $wide Ultra-wide display breakpoint boundary (1440px).
12
+ * @property $text-elements Selector list of inline and text elements receiving text-box-trim for baseline grid alignment.
13
+ * @property $rhythm-simple-tags Selector list of standard flow elements spaced by single rhythm gap.
14
+ * @property $rhythm-double-tags Selector list of heavier block elements spaced by multiplied rhythm margin.
15
+ * @property $rhythm-tags Union selector list of all rhythm-managed elements.
16
+ * @property %surface Placeholder selector applying card/surface elevation, radius, and background.
17
+ * @property %padding-text Placeholder selector applying standard text control padding.
18
+ * @property $stnd-theme-scope CSS selector scope for theme token assignment (`:root` by default).
12
19
  *
13
- * @example
20
+ * @example scss
14
21
  * // Using breakpoint variables
15
22
  * @media (min-width: $small) {
16
23
  * font-size: 1.2rem;
17
24
  * }
18
25
  *
19
- * // Using rhythm mixin
20
- * @include apply-rhythm {
21
- * margin-bottom: var(--space);
26
+ * // Extending surface placeholder
27
+ * .my-panel {
28
+ * @extend %surface;
22
29
  * }
23
30
  *
24
31
  * @since 0.1.0
@@ -4,10 +4,20 @@
4
4
  * @component Design Tokens
5
5
  * @category Foundation
6
6
  * @description Primitive design tokens forming the foundation of the design system.
7
- * Includes mathematical ratios, modular scales, spacing system, and animation curves.
7
+ * Includes mathematical ratios, modular scales, spacing system, layout widths, z-index hierarchy, animation curves, and seed colors.
8
8
  */
9
9
 
10
10
  #{$stnd-theme-scope} {
11
+ /**
12
+ * @name Color Seeds & Tooltips
13
+ * @description Primary background and foreground seeds from which the OKLCH relative color engine derives full palettes, plus tooltip defaults.
14
+ *
15
+ * @property {variable} --color-light-background Light mode root page background seed (`white`).
16
+ * @property {variable} --color-light-foreground Light mode root text foreground seed (`#262626`). Derives dark mode seeds and the full 10-hue chromatic wheel.
17
+ * @property {variable} --tooltip-background Default tooltip container background (`var(--color-dark, #1a1a1a)`).
18
+ * @property {variable} --tooltip-text Default tooltip text color (`var(--color-light, #ffffff)`).
19
+ */
20
+
11
21
  /* ===== COLOR SEEDS =====
12
22
  The two primary seeds from which everything grows.
13
23
  Set these and the color file (_standard-02-color.scss) does the rest:
@@ -33,19 +43,45 @@
33
43
  foreground's OKLCH hue — warm ink begets warm dark mode. */
34
44
 
35
45
  /* Tooltip defaults */
36
- --tooltip-background: #1a1a1a;
37
- --tooltip-text: #ffffff;
46
+ --tooltip-background: var(--color-dark, #1a1a1a);
47
+ --tooltip-text: var(--color-light, #ffffff);
48
+
49
+ /**
50
+ * @name Base Measurements & Vertical Rhythm
51
+ * @description Core measurements governing typography and vertical cadence. Includes fluid viewport scaling and baseline rhythm anchoring.
52
+ *
53
+ * @property {variable} --optical-ratio Modular scale ratio. Resolves theme hook `--font-ratio` with fallback to `--ratio-silver`.
54
+ * @property {variable} --physics-slope Ratio growth physics slope derived from optical ratio (`max(calc(var(--optical-ratio) - 1), 0.15)`).
55
+ * @property {variable} --fluid-growth Viewport-responsive growth increment (`calc(var(--physics-slope) * 1.2vw)`).
56
+ * @property {variable} --base-size Root font size base (defaults to `--font-text-size` or `1.0625rem`).
57
+ * @property {variable} --font-size Clamped fluid font size that scales smoothly between mobile and wide displays.
58
+ * @property {variable} --density-base Reading density base resolving from `--font-density` or `--optical-ratio`.
59
+ * @property {variable} --line-height Clamped fluid unitless line height (1.35 to 1.75).
60
+ * @property {variable} --baseline Official rhythm unit (`1rlh`). Drives vertical spacing across all components.
61
+ * @property {variable} --trim Half-leading trim applied to typography box edges (`calc(var(--leading) / 2)`).
62
+ * @property {variable} --leading Space between font cap-height and the next baseline (`calc((var(--line-height) - 1) * var(--font-size))`).
63
+ * @property {variable} --nl Newline unit representing a full vertical rhythm step (`calc(var(--leading) * var(--line-height))`).
64
+ */
38
65
 
39
66
  /* Base measurements & ratios. --font-ratio / --font-density are the
40
67
  theme-authoring hooks (set by ~a dozen packages/themes/*.scss files,
41
68
  e.g. --font-ratio: 1.414) — --optical-ratio / --line-height are the
42
- resolved, framework-consumed values. A note's frontmatter can also
43
- override --optical-ratio directly (it's the registered token name),
44
- which bypasses --font-ratio entirely since the more specific
45
- declaration wins regardless of this fallback chain. */
46
- --font-size: 1rem;
69
+ resolved, framework-consumed values. */
47
70
  --optical-ratio: var(--font-ratio, var(--ratio-silver));
48
- --line-height: var(--font-density, var(--optical-ratio));
71
+
72
+ /* Fluid typography slopes: the optical ratio drives responsiveness */
73
+ --physics-slope: max(calc(var(--optical-ratio) - 1), 0.15);
74
+ --fluid-growth: calc(var(--physics-slope) * 1.2vw);
75
+ --base-size: var(--font-text-size, 1.0625rem);
76
+ --font-size: clamp(
77
+ var(--base-size),
78
+ calc(var(--base-size) + var(--fluid-growth)),
79
+ calc(var(--base-size) * 1.3)
80
+ );
81
+
82
+ /* Fluid line-height: resolves from theme density or optical ratio */
83
+ --density-base: var(--font-density, var(--optical-ratio));
84
+ --line-height: clamp(1.35, var(--density-base), 1.75);
49
85
 
50
86
  /* Baseline: the official rhythm unit */
51
87
  --baseline: 1rlh;
@@ -55,24 +91,64 @@
55
91
  --leading: calc((var(--line-height) - 1) * var(--font-size));
56
92
  --nl: calc(var(--leading) * var(--line-height));
57
93
 
94
+ /**
95
+ * @name Rhythm & Gaps
96
+ * @description Spacing intervals between major layout blocks, page sections, headers, and footers.
97
+ *
98
+ * @property {variable} --gap Dynamic gap between rhythm blocks (`calc(var(--space) * var(--optical-ratio))`).
99
+ * @property {variable} --gap-body Standard gutter for body content containers (`var(--space-2)`).
100
+ * @property {variable} --gap-header Top margin gutter above page headers (`var(--space-8)`).
101
+ * @property {variable} --gap-footer Bottom margin gutter above page footers (`calc(var(--gap-body) * 1.5)`).
102
+ * @property {variable} --gap-grid-img Micro-gap separating adjacent images in rhythm grids (`var(--space-d4)`).
103
+ * @property {variable} --gap-multiplicator Gutter multiplier factor (`2`).
104
+ */
58
105
  /* Gap, space between blocks in rhythm, goes to --space in mobile */
59
- --gap: calc(var(--space) * var(--optical-ratio));
106
+ --gap: calc(var(--space));
60
107
  --gap-body: var(--space-2);
61
108
  --gap-header: var(--space-8);
62
109
  --gap-footer: calc(var(--gap-body) * 1.5);
63
110
  --gap-grid-img: var(--space-d4);
64
111
  --gap-multiplicator: 2;
65
112
 
113
+ /**
114
+ * @name Breakpoints
115
+ * @description Viewport boundaries for responsive layout adaptations across mobile, tablet, and desktop displays.
116
+ *
117
+ * @property {variable} --breakpoint-mobile Mobile viewport breakpoint boundary (`#{$mobile}`).
118
+ * @property {variable} --breakpoint-sm Small tablet and compact screen breakpoint boundary (`#{$small}`).
119
+ * @property {variable} --breakpoint-lg Large desktop screen breakpoint boundary (`#{$large}`).
120
+ * @property {variable} --breakpoint-wide Ultra-wide display breakpoint boundary (`#{$wide}`).
121
+ */
66
122
  --breakpoint-mobile: #{$mobile};
67
123
  --breakpoint-sm: #{$small};
68
124
  --breakpoint-lg: #{$large};
69
125
  --breakpoint-wide: #{$wide};
70
126
 
127
+ /**
128
+ * @name Content Breakout Widths
129
+ * @description Grid breakout track sizes allowing editorial content, features, and media to extend past the reading measure.
130
+ *
131
+ * @property {variable} --content-width-sm Small layout breakout track width (`max(calc(var(--space-2) - var(--space)), var(--space))`).
132
+ * @property {variable} --content-width-editorial Editorial column breakout track width (`minmax(0, var(--space-2))`).
133
+ * @property {variable} --content-width-feature Feature callout breakout track width (`minmax(0, var(--space-4))`).
134
+ * @property {variable} --content-width-hero Full-bleed hero breakout track width (`minmax(0, 1fr)`).
135
+ */
71
136
  --content-width-sm: max(calc(var(--space-2) - var(--space)), var(--space));
72
137
  --content-width-editorial: minmax(0, var(--space-2));
73
138
  --content-width-feature: minmax(0, var(--space-4));
74
139
  --content-width-hero: minmax(0, 1fr);
75
140
 
141
+ /**
142
+ * @name Stroke, Radius & Filters
143
+ * @description Hairline strokes, corner curvature, and glassmorphic backdrop filters.
144
+ *
145
+ * @property {variable} --stroke-width Hairline border stroke width (`max(1px, 0.06rem)`).
146
+ * @property {variable} --stroke-width-lg Heavy border stroke width (`calc(var(--stroke-width) * 2)`).
147
+ * @property {variable} --radius Border radius proportional to leading. Resolves theme hook `--corner` or derives proportionally from `--leading`.
148
+ * @property {variable} --radius-sm Small border radius for badges, inputs, and buttons (`min(8px, var(--radius))`).
149
+ * @property {variable} --filter-blur Standard blur filter (`blur(8px)`).
150
+ * @property {variable} --filter-glass Deep glassmorphic blur filter for overlays and floating panels (`blur(20px)`).
151
+ */
76
152
  /* Design system tokens */
77
153
  --filter-blur: blur(8px);
78
154
  --filter-glass: blur(20px);
@@ -84,6 +160,48 @@
84
160
  --radius: var(--corner, var(--leading));
85
161
  --radius-sm: min(8px, var(--radius));
86
162
 
163
+ /**
164
+ * @name Shadows & Elevation
165
+ * @description Multi-layered elevation scale and presets driven by semantic color seeds.
166
+ *
167
+ * @property {variable} --shadow-ambient Subtle ambient contact shadow.
168
+ * @property {variable} --shadow-lift Medium elevation shadow with directional lift.
169
+ * @property {variable} --shadow-glow Atmospheric ambient glow shadow.
170
+ * @property {variable} --shadow-inset Inset bevel shadow.
171
+ * @property {variable} --shadow-ring Fine border ring inset shadow.
172
+ * @property {variable} --shadow-raised Layered raised preset with top highlight, hairline border, and ambient shadow.
173
+ * @property {variable} --shadow Default elevation shadow.
174
+ * @property {variable} --shadow-lg Large floating dialog/card shadow.
175
+ * @property {variable} --shadow-xl Maximum elevation hero shadow.
176
+ */
177
+ --shadow-ambient: 0 1px 1px var(--color-shadow);
178
+ --shadow-lift:
179
+ 0 4px 6px -1px var(--color-shadow), 0 2px 4px -2px var(--color-shadow);
180
+ --shadow-glow: 0 4px var(--space) oklch(from var(--color-shadow) l c h / 0.15);
181
+ --shadow-inset:
182
+ inset 0 1px 3px var(--color-shadow), inset 0 -1px 0 0 var(--color-highlight);
183
+ --shadow-ring:
184
+ inset 0px 1px 1px var(--color-border),
185
+ inset 1px 0px 1px var(--color-border),
186
+ inset -1px 0px 1px var(--color-border),
187
+ inset 0px -1px 1px var(--color-border);
188
+ --shadow-raised:
189
+ inset 0 1px 0 0 var(--color-highlight), 0 0 0 1px var(--color-border),
190
+ var(--shadow-ambient);
191
+ --shadow: var(--shadow-ambient);
192
+ --shadow-lg: var(--shadow-ambient), var(--shadow-lift);
193
+ --shadow-xl: var(--shadow-ambient), var(--shadow-lift), var(--shadow-glow);
194
+
195
+ /**
196
+ * @name Mathematical Ratios
197
+ * @description Proportional ratios driving modular scales, typographic scaling, and harmonic layout proportions.
198
+ *
199
+ * @property {variable} --ratio-golden Golden ratio (φ ≈ 1.618). Used for golden spiral proportions and dramatic growth slopes.
200
+ * @property {variable} --ratio-silver Silver ratio (√2 ≈ 1.414). Default modular scale factor for typography and optical steps.
201
+ * @property {variable} --ratio-halfstep Half-step ratio (1.272). Moderate progression for subtle hierarchy.
202
+ * @property {variable} --ratio-quarterstep Quarter-step ratio (1.128). Tighter step progression for compact interfaces.
203
+ * @property {variable} --ratio-eighthstep Eighth-step ratio (1.062). Minimal step increment for dense data displays.
204
+ */
87
205
  /* Golden Ratio & Mathematical Precision */
88
206
  --ratio-golden: 1.618;
89
207
  --ratio-silver: 1.414;
@@ -91,6 +209,20 @@
91
209
  --ratio-quarterstep: 1.128;
92
210
  --ratio-eighthstep: 1.062;
93
211
 
212
+ /**
213
+ * @name Layout & Reading Widths
214
+ * @description Column constraints for prose reading measure and outer page boundaries.
215
+ *
216
+ * @property {variable} --body-max-width Maximum width of the entire page shell (`900px`). Constrains headers, prose, and footers.
217
+ * @property {variable} --line-width-xs Extra-small reading width (`24rem`). Ideal for cards, sidebars, and captions.
218
+ * @property {variable} --line-width-sm Small reading width (`32rem`).
219
+ * @property {variable} --line-width-md Medium reading width (`42rem`). Optimal reading line length (approx. 65-75 characters).
220
+ * @property {variable} --line-width-lg Large reading width (`50rem`).
221
+ * @property {variable} --line-width-xl Extra-large reading width (`60rem`).
222
+ * @property {variable} --line-width-full Full viewport width minus gutters (`calc(100vw - (var(--space) * 2))`).
223
+ * @property {variable} --line-width Active reading column measure. Resolves `--font-line-width`, `--measure`, or `--line-width-md`.
224
+ * @property {variable} --content-width Effective content width constrained to container (`min(var(--line-width), 100%)`).
225
+ */
94
226
  /* Layout width — body-max-width is the whole page shell (header, footer,
95
227
  content); .prose's own box reads it directly, so .hero/.full breakout
96
228
  elements grow into it too. line-width is a single line of readable
@@ -114,6 +246,16 @@
114
246
 
115
247
  --content-width: min(var(--line-width), 100%);
116
248
 
249
+ /**
250
+ * @name Line Heights & Letter Spacing
251
+ * @description Tracking adjustments and proportional line height variants.
252
+ *
253
+ * @property {variable} --line-height-compact Compact line height (`calc(1 + (var(--line-height) - 1) / 2)`). Used for titles and tight headings.
254
+ * @property {variable} --line-height-relaxed Relaxed line height (`calc(1 + (var(--line-height) - 1) * 1.5)`). Used for loose longform prose.
255
+ * @property {variable} --tracking-tight Tight letter-spacing (`-0.01em`). Applied to large display headings.
256
+ * @property {variable} --tracking-neutral Normal letter-spacing (`0em`). Default for body text.
257
+ * @property {variable} --tracking-open Open letter-spacing (`0.01em`). Applied to uppercase labels and small caps.
258
+ */
117
259
  --line-height-compact: calc(1 + (var(--line-height) - 1) / 2);
118
260
  --line-height-relaxed: calc(1 + (var(--line-height) - 1) * 1.5);
119
261
 
@@ -121,6 +263,37 @@
121
263
  --tracking-neutral: 0em;
122
264
  --tracking-open: 0.01em;
123
265
 
266
+ /**
267
+ * @name Spacing Scale
268
+ * @description Complete vertical rhythm scale derived from `--baseline` (1rlh). Division steps (`--space-d*`) subdivide the baseline; multiplication steps (`--space-*`) expand it.
269
+ *
270
+ * @property {variable} --space Base rhythm spacing unit (`var(--baseline)`, 1rlh).
271
+ * @property {variable} --space-half Half-space rhythm unit (`calc(var(--baseline) / 2)`).
272
+ * @property {variable} --space-d1 Division step 1 (`calc(var(--space) / 1)`).
273
+ * @property {variable} --space-d2 Division step 2 (`calc(var(--space) / 2)`). Half-step spacing for compact padding and gaps.
274
+ * @property {variable} --space-d3 Division step 3 (`calc(var(--space) / 3)`). One-third baseline spacing.
275
+ * @property {variable} --space-d4 Division step 4 (`calc(var(--space) / 4)`). Quarter baseline spacing for micro-gaps and badge padding.
276
+ * @property {variable} --space-d5 Division step 5 (`calc(var(--space) / 5)`).
277
+ * @property {variable} --space-d6 Division step 6 (`calc(var(--space) / 6)`).
278
+ * @property {variable} --space-d7 Division step 7 (`calc(var(--space) / 7)`).
279
+ * @property {variable} --space-d8 Division step 8 (`calc(var(--space) / 8)`). Micro-hairline spacing for dense lists and borders.
280
+ * @property {variable} --space-d9 Division step 9 (`calc(var(--space) / 9)`).
281
+ * @property {variable} --space-d10 Division step 10 (`calc(var(--space) / 10)`).
282
+ * @property {variable} --space-d11 Division step 11 (`calc(var(--space) / 11)`).
283
+ * @property {variable} --space-d12 Division step 12 (`calc(var(--space) / 12)`). Smallest fractional spacing step.
284
+ * @property {variable} --space-1 Multiplication step 1 (`calc(var(--space) * 1)`). Equals base `--space`.
285
+ * @property {variable} --space-2 Multiplication step 2 (`calc(var(--space) * 2)`). Standard body gutter and section spacing.
286
+ * @property {variable} --space-3 Multiplication step 3 (`calc(var(--space) * 3)`). Intermediate container margin.
287
+ * @property {variable} --space-4 Multiplication step 4 (`calc(var(--space) * 4)`). Feature breakout margin and block rhythm.
288
+ * @property {variable} --space-5 Multiplication step 5 (`calc(var(--space) * 5)`).
289
+ * @property {variable} --space-6 Multiplication step 6 (`calc(var(--space) * 6)`). Large section gap.
290
+ * @property {variable} --space-7 Multiplication step 7 (`calc(var(--space) * 7)`).
291
+ * @property {variable} --space-8 Multiplication step 8 (`calc(var(--space) * 8)`). Page header gap and macro layout spacing.
292
+ * @property {variable} --space-9 Multiplication step 9 (`calc(var(--space) * 9)`).
293
+ * @property {variable} --space-10 Multiplication step 10 (`calc(var(--space) * 10)`).
294
+ * @property {variable} --space-11 Multiplication step 11 (`calc(var(--space) * 11)`).
295
+ * @property {variable} --space-12 Multiplication step 12 (`calc(var(--space) * 12)`). Maximum rhythm spacing step.
296
+ */
124
297
  /* Spacing scale (derived from baseline). "d" prefix = divide (space-d4 =
125
298
  space / 4), plain number = multiply (space-4 = space * 4) — same "d"
126
299
  convention repeats below in the type scale. */
@@ -132,6 +305,35 @@
132
305
  --space-#{$i}: calc(var(--space) * #{$i});
133
306
  }
134
307
 
308
+ /**
309
+ * @name Optical Harmony Scale & Sizes
310
+ * @description Modular geometric scale driven by `--optical-ratio` for typography and sizing. Sub-base steps (d5..d2) use a flattened divisor and floor at 11px to protect legibility.
311
+ *
312
+ * @property {variable} --scale-d5 Sub-base optical step -5 (`max(calc(var(--font-size) / (var(--optical-ratio) * var(--optical-ratio))), 11px)`).
313
+ * @property {variable} --scale-d4 Sub-base optical step -4 (`max(calc(var(--font-size) / (var(--optical-ratio) * 1.25)), 11px)`).
314
+ * @property {variable} --scale-d3 Sub-base optical step -3 (`max(calc(var(--font-size) / var(--optical-ratio)), 11px)`).
315
+ * @property {variable} --scale-d2 Sub-base optical step -2 (`max(calc(var(--font-size) / (1 + (var(--optical-ratio) - 1) * 0.5)), 11px)`).
316
+ * @property {variable} --scale Base optical scale step (`var(--font-size)`).
317
+ * @property {variable} --scale-2 Super-base optical step 2 (`calc(var(--font-size) * var(--optical-ratio))`).
318
+ * @property {variable} --scale-3 Super-base optical step 3 (`calc(var(--scale-2) * var(--optical-ratio))`).
319
+ * @property {variable} --scale-4 Super-base optical step 4 (`calc(var(--scale-3) * var(--optical-ratio))`).
320
+ * @property {variable} --scale-5 Super-base optical step 5 (`calc(var(--scale-4) * var(--optical-ratio))`).
321
+ * @property {variable} --scale-6 Super-base optical step 6 (`calc(var(--scale-5) * var(--optical-ratio))`).
322
+ * @property {variable} --scale-7 Super-base optical step 7 (`calc(var(--scale-6) * var(--optical-ratio))`).
323
+ * @property {variable} --scale-8 Super-base optical step 8 (`calc(var(--scale-7) * var(--optical-ratio))`).
324
+ * @property {variable} --size-3xs T-shirt size alias for `--scale-d5`. Used for micro-badges and metadata captions.
325
+ * @property {variable} --size-2xs T-shirt size alias for `--scale-d4`. Used for tooltips, footnotes, and tags.
326
+ * @property {variable} --size-xs T-shirt size alias for `--scale-d3`. Used for secondary labels and table metadata.
327
+ * @property {variable} --size-sm T-shirt size alias for `--scale-d2`. Used for UI controls, inputs, and captions.
328
+ * @property {variable} --size-base T-shirt size alias for `--scale`. Base body text size (`1rem`).
329
+ * @property {variable} --size-lg T-shirt size alias for `--scale-2`. Subheadings and lead paragraphs.
330
+ * @property {variable} --size-xl T-shirt size alias for `--scale-3`. Section headers (`h3`).
331
+ * @property {variable} --size-2xl T-shirt size alias for `--scale-4`. Major headings (`h2`).
332
+ * @property {variable} --size-3xl T-shirt size alias for `--scale-5`. Page titles (`h1`).
333
+ * @property {variable} --size-4xl T-shirt size alias for `--scale-6`. Hero display headings.
334
+ * @property {variable} --size-5xl T-shirt size alias for `--scale-7`. Large hero numbers and display text.
335
+ * @property {variable} --size-6xl T-shirt size alias for `--scale-8`. Maximum display typography scale.
336
+ */
135
337
  /* Optical harmony scale. --scale-2 upward is a clean geometric progression
136
338
  (each step = previous * --optical-ratio). Below base (d5..d2) the
137
339
  divisor is deliberately NOT the mirrored geometric inverse (ratio^-1,
@@ -172,12 +374,33 @@
172
374
  --size-5xl: var(--scale-7);
173
375
  --size-6xl: var(--scale-8);
174
376
 
377
+ /**
378
+ * @name Mobile Settings
379
+ * @description Responsive overrides applied on mobile screen sizes.
380
+ *
381
+ * @property {variable} --font-size-mobile Base font size override on mobile viewports (`1.125rem`).
382
+ * @property {variable} --gap-body-mobile Body gutter override on mobile viewports (`var(--space)`).
383
+ * @property {variable} --gap-mobile General layout gap override on mobile viewports (`var(--space)`).
384
+ * @property {variable} --gap-header-mobile Header gutter override on mobile viewports (`var(--space-4)`).
385
+ */
175
386
  /* Mobile settings */
176
387
  --font-size-mobile: 1.125rem;
177
388
  --gap-body-mobile: var(--space);
178
389
  --gap-mobile: var(--space);
179
390
  --gap-header-mobile: var(--space-4);
180
391
 
392
+ /**
393
+ * @name Z-Index Scale
394
+ * @description Consistent stacking order hierarchy preventing z-index collisions.
395
+ *
396
+ * @property {variable} --z-base Base stacking layer above standard document flow (`1`).
397
+ * @property {variable} --z-header Sticky page header layer (`900`).
398
+ * @property {variable} --z-launcher Command launcher and quick-search palette (`1000`).
399
+ * @property {variable} --z-dropdown Dropdowns, popovers, and context menus (`1100`).
400
+ * @property {variable} --z-modal Modal dialogs and backdrop scrims (`1200`).
401
+ * @property {variable} --z-toast Toast notifications and system alerts (`2000`).
402
+ * @property {variable} --z-image-zoom Fullscreen lightbox image zoom overlay (`9999`).
403
+ */
181
404
  /* Z-index scale */
182
405
  --z-base: 1;
183
406
  --z-dropdown: 1100;
@@ -189,6 +412,35 @@
189
412
  --z-launcher: 1000;
190
413
  --z-image-zoom: 9999;
191
414
 
415
+ /**
416
+ * @name Animation, Timing & Curves
417
+ * @description Cubic bezier easing curves, transition durations, and physics-driven motion presets.
418
+ *
419
+ * @property {variable} --ease-snappy Fast response curve for small icons and toggles (`cubic-bezier(0.2, 0, 0, 1)`).
420
+ * @property {variable} --ease-standard Standard curve for general UI transitions (`cubic-bezier(0.4, 0, 0.2, 1)`).
421
+ * @property {variable} --ease-soft Gentle curve for large modals, overlays, and drawer panels (`cubic-bezier(0.16, 1, 0.3, 1)`).
422
+ * @property {variable} --ease-emphasis Weighted curve with anticipation and subtle overshoot (`cubic-bezier(0.34, 1.56, 0.64, 1)`).
423
+ * @property {variable} --ease-aggressive Rapid acceleration curve for urgent transitions (`cubic-bezier(0.7, 0, 0.3, 1)`).
424
+ * @property {variable} --ease-stnd Standard signature ease curve (`cubic-bezier(0, 0.3, 0, 1)`).
425
+ * @property {variable} --ease-stnd-heavy Heavy standard signature ease curve (`cubic-bezier(0.5, 0, 0, 1)`).
426
+ * @property {variable} --ease-invisibolt Sudden bolt curve (`cubic-bezier(1, 0, 0, 1)`).
427
+ * @property {variable} --ease-friction Analog physical friction curve with swift attack and long taper (`cubic-bezier(0.22, 1, 0.36, 1)`).
428
+ * @property {variable} --duration-instant Instant duration for micro-interactions (`100ms`).
429
+ * @property {variable} --duration-fast Fast duration for button hover, active states, and menus (`350ms`).
430
+ * @property {variable} --duration-standard Standard duration for UI component state transitions (`500ms`).
431
+ * @property {variable} --duration-slow Slow duration for large panels, dialogs, and navigation sheets (`1000ms`).
432
+ * @property {variable} --transition-fast Fast transition shorthand (`0.5s var(--ease-friction)`).
433
+ * @property {variable} --transition Standard transition shorthand (`1s var(--ease-friction)`).
434
+ * @property {variable} --transition-slow Slow transition shorthand (`2s var(--ease-friction)`).
435
+ * @property {variable} --ease-shape-snappy Snappy shape alias curve (`cubic-bezier(0.2, 0, 0, 1)`).
436
+ * @property {variable} --ease-shape-bounce Bouncy shape alias curve with overshoot (`cubic-bezier(0.34, 1.56, 0.64, 1)`).
437
+ * @property {variable} --ease-shape-soft Soft shape alias curve (`cubic-bezier(0.16, 1, 0.3, 1)`).
438
+ * @property {variable} --ease-interaction Preset transition for interactive controls (`var(--duration-fast) var(--ease-shape-snappy)`).
439
+ * @property {variable} --ease-feedback Preset transition for validation and feedback states (`var(--duration-standard) var(--ease-shape-bounce)`).
440
+ * @property {variable} --ease-surface Preset transition for large panels and sidebars (`var(--duration-slow) var(--ease-shape-soft)`).
441
+ * @property {variable} --ease-enter Preset transition for entering elements (`var(--duration-fast) ease-out`).
442
+ * @property {variable} --ease-exit Preset transition for exiting elements (`var(--duration-standard) ease-in`).
443
+ */
192
444
  /* The *“Snappy”* - for small icons or toggles (Short duration) */
193
445
  --ease-snappy: cubic-bezier(0.2, 0, 0, 1);
194
446
 
@@ -266,6 +518,17 @@
266
518
  /* Enter/Exit (Modals, tooltips) */
267
519
  --ease-enter: var(--duration-fast) ease-out;
268
520
  --ease-exit: var(--duration-standard) ease-in;
521
+
522
+ /**
523
+ * @name Theme Authoring Hooks
524
+ * @description Documented custom property hooks intended for themes (`packages/themes/*`) and document frontmatter overrides.
525
+ *
526
+ * @property {variable} --font-ratio Theme-authoring hook to override the optical modular scale factor (e.g. `1.414`).
527
+ * @property {variable} --font-density Theme-authoring hook to override base line height density.
528
+ * @property {variable} --font-line-width Theme-authoring hook to override default reading column measure.
529
+ * @property {variable} --measure Editor and writer component hook to override active text measure.
530
+ * @property {variable} --corner Theme-authoring hook to override base border radius.
531
+ */
269
532
  }
270
533
 
271
534
  #{$text-elements},