@stnd/styles 0.8.0 → 0.10.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,17 @@
1
1
  # @stnd/styles
2
2
 
3
+ ## 0.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Auto-bumped @stnd/styles due to modified code.
8
+
9
+ ## 0.9.0
10
+
11
+ ### Minor Changes
12
+
13
+ - Auto-bumped @stnd/styles due to modified code.
14
+
3
15
  ## 0.8.0
4
16
 
5
17
  ### Minor Changes
package/README.md CHANGED
@@ -113,6 +113,7 @@ In your main SCSS stylesheet or Astro entry point:
113
113
 
114
114
  ### Style Files Anatomy
115
115
  - `standard.scss`: Framework index.
116
+ - `app.scss`: Opt-in tokens for an application window (fixed type scale, chrome-paced motion, radius, and the window-chrome set `--window-radius` / `--window-inset` / `--pane-radius`). Import after the theme.
116
117
  - `_standard-01-token.scss`: Variable dictionary.
117
118
  - `_standard-02-color.scss`: Color space equations.
118
119
  - `_standard-03-typography.scss`: Typography stacks.
@@ -175,6 +175,51 @@
175
175
  }
176
176
  }
177
177
 
178
+ /* Screen break & section transitions (T54) */
179
+ .stnd-screen-break {
180
+ grid-column: 1 / -1;
181
+ border: none;
182
+ height: 1px;
183
+ background: var(--color-border-subtle, rgba(125, 125, 125, 0.2));
184
+ margin-block: var(--gap-section, 6rem);
185
+ margin-inline: auto;
186
+ width: min(100%, 18rem);
187
+ position: relative;
188
+ scroll-margin-top: calc(var(--gap-header, 3.5rem) + 1.5rem);
189
+
190
+ &.screen-full {
191
+ width: 100%;
192
+ min-height: 80vh;
193
+ background: transparent;
194
+ margin-block: 0;
195
+ display: flex;
196
+ align-items: center;
197
+ justify-content: center;
198
+
199
+ &::after {
200
+ content: "✦";
201
+ color: var(--color-muted, #888);
202
+ opacity: 0.5;
203
+ font-size: 1.25rem;
204
+ }
205
+ }
206
+ }
207
+
208
+ .stnd-screen-section {
209
+ grid-column: 1 / -1;
210
+ width: 100%;
211
+ margin-block: var(--gap-section, 4rem);
212
+ scroll-margin-top: calc(var(--gap-header, 3.5rem) + 1.5rem);
213
+
214
+ &.screen-full {
215
+ min-height: 85vh;
216
+ display: flex;
217
+ flex-direction: column;
218
+ justify-content: center;
219
+ margin-block: 0;
220
+ }
221
+ }
222
+
178
223
  /* Image gallery layout */
179
224
  &:not(.no-grid) {
180
225
  p:has(img),
@@ -387,6 +387,47 @@
387
387
  margin-inline: auto !important;
388
388
  }
389
389
 
390
+ .stnd-screen-break {
391
+ border: none;
392
+ height: 1px;
393
+ background: var(--color-border-subtle, rgba(125, 125, 125, 0.2));
394
+ margin-block: var(--gap-section, 6rem);
395
+ margin-inline: auto;
396
+ width: min(100%, 18rem);
397
+ scroll-margin-top: calc(var(--gap-header, 3.5rem) + 1.5rem);
398
+
399
+ &.screen-full {
400
+ width: 100%;
401
+ min-height: 80vh;
402
+ background: transparent;
403
+ margin-block: 0;
404
+ display: flex;
405
+ align-items: center;
406
+ justify-content: center;
407
+
408
+ &::after {
409
+ content: "✦";
410
+ color: var(--color-muted, #888);
411
+ opacity: 0.5;
412
+ font-size: 1.25rem;
413
+ }
414
+ }
415
+ }
416
+
417
+ .stnd-screen-section {
418
+ width: 100%;
419
+ margin-block: var(--gap-section, 4rem);
420
+ scroll-margin-top: calc(var(--gap-header, 3.5rem) + 1.5rem);
421
+
422
+ &.screen-full {
423
+ min-height: 85vh;
424
+ display: flex;
425
+ flex-direction: column;
426
+ justify-content: center;
427
+ margin-block: 0;
428
+ }
429
+ }
430
+
390
431
  /* ============================================================ */
391
432
  /* TYPOGRAPHY — Size */
392
433
  /* ============================================================ */
package/app.scss ADDED
@@ -0,0 +1,81 @@
1
+ /**
2
+ * @component App Tokens
3
+ * @category Foundation
4
+ * @description Re-grounds the framework's tokens for an APPLICATION window
5
+ * instead of a document read in a browser. Opt-in: import it after
6
+ * standard.scss and after the theme.
7
+ *
8
+ * standard.scss is a note framework. It assumes fluid type that grows with
9
+ * the viewport, a mobile breakpoint that bumps text up on narrow screens, a
10
+ * reading measure, durations paced for reading. An app window is none of
11
+ * that: density is fixed, chrome is chrome, and a narrow window is just a
12
+ * small window.
13
+ *
14
+ * Unconditional `:root`, not `[data-theme]`: these are facts about the
15
+ * window, true whichever theme supplies the colour and font seeds.
16
+ *
17
+ * @property --window-radius The OS window's own corner radius.
18
+ * @property --window-inset Gap between the window edge and a floating pane.
19
+ * @property --pane-radius Corner of a pane floating inside the window.
20
+ */
21
+ :root {
22
+ /* ---- Type ------------------------------------------------------------
23
+ Fixed UI scale (native macOS text runs ~13px). Wins over the fluid
24
+ clamp() in _standard-03-typography.scss by specificity. */
25
+ --font-text-size: 13px;
26
+ --font-size: var(--font-text-size);
27
+
28
+ /* The <768px breakpoint re-sets --font-size / --gap* from these mobile
29
+ tokens with !important. On the web that is comfort on a phone; in an
30
+ app it means text GROWS when the window shrinks. Point the mobile
31
+ tokens at the desktop values so the breakpoint becomes a no-op.
32
+ (Gap formulas are duplicated rather than var(--gap)-referenced —
33
+ referencing the token they feed would create a custom-property cycle.) */
34
+ --font-size-mobile: var(--font-text-size);
35
+ --gap-mobile: calc(var(--space) * var(--optical-ratio));
36
+ --gap-body-mobile: var(--space-2);
37
+ --gap-header-mobile: var(--space-8);
38
+
39
+ /* Tighter modular scale than the silver default — in an app, headings
40
+ are labels and section chrome, not display type. */
41
+ --font-ratio: 1.333;
42
+
43
+ /* ---- Motion ----------------------------------------------------------
44
+ The framework's durations (350 / 500 / 1000ms) are paced for a page
45
+ settling under your eyes. Chrome has to feel immediate under the
46
+ cursor. Same names, so components stay themeable from one place. */
47
+ --duration-instant: 120ms;
48
+ --duration-fast: 150ms;
49
+ --duration-standard: 180ms;
50
+ --duration-slow: 300ms;
51
+
52
+ /* ---- Radius ----------------------------------------------------------
53
+ The framework derives --radius from --leading, a TYPOGRAPHIC rhythm
54
+ value (~2.6px at 13px / 1.2), not a chrome corner. --corner is the
55
+ framework's own escape hatch for exactly this.
56
+ --radius-sm is set explicitly: the framework's min(8px, --radius)
57
+ would collapse onto --radius and stop being a distinct step.
58
+ --radius-lg has no framework equivalent; declared here so it is real. */
59
+ --corner: 6px; /* feeds --radius */
60
+ --radius-sm: 4px;
61
+ --radius-lg: 12px;
62
+
63
+ /* ---- Window chrome ---------------------------------------------------
64
+ A pane floating inside the window (a sidebar, an inspector) sits
65
+ --window-inset from the edge, and its corner is CONCENTRIC with the
66
+ window's: same centre, so radius = window radius − inset. That is the
67
+ rule macOS follows for its own inset sidebars; a pane radius picked
68
+ on its own never lines up with the window corner around it.
69
+
70
+ --window-radius is the one number that has to match the OS, and Apple
71
+ does not publish it: the HIG gives the concentric RULE (WWDC25, "Build
72
+ an AppKit app with the new design"), and native code gets it for free
73
+ (SwiftUI ConcentricRectangle / containerShape), but a web view has to
74
+ be told. MEASURED 2026-09-23 on Darwin 27 (the macOS after Tahoe), from Reveal's own window
75
+ (screencapture -o, circle fit on the corner's alpha edge): 17pt. That
76
+ is the titlebar-only radius. A window with an NSToolbar gets a larger
77
+ one; an app that has one should override this token, not the panes. */
78
+ --window-radius: 17px;
79
+ --window-inset: 8px;
80
+ --pane-radius: calc(var(--window-radius) - var(--window-inset));
81
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stnd/styles",
3
- "version": "0.8.0",
3
+ "version": "0.10.0",
4
4
  "type": "module",
5
5
  "author": "Francis Fontaine",
6
6
  "license": "MIT",
@@ -9,6 +9,7 @@
9
9
  "exports": {
10
10
  ".": "./index.js",
11
11
  "./standard.scss": "./standard.scss",
12
+ "./app.scss": "./app.scss",
12
13
  "./reset": "./_standard-00-reset.scss",
13
14
  "./variables": "./_standard-00-variables.scss",
14
15
  "./tokens": "./_standard-01-token.scss",