@stnd/styles 0.9.0 → 0.10.1
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 +12 -0
- package/README.md +1 -0
- package/app.scss +89 -0
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
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.
|
package/app.scss
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
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
|
+
* @property --titlebar-height Band centred on the OS traffic lights.
|
|
21
|
+
*/
|
|
22
|
+
:root {
|
|
23
|
+
/* ---- Type ------------------------------------------------------------
|
|
24
|
+
Fixed UI scale (native macOS text runs ~13px). Wins over the fluid
|
|
25
|
+
clamp() in _standard-03-typography.scss by specificity. */
|
|
26
|
+
--font-text-size: 13px;
|
|
27
|
+
--font-size: var(--font-text-size);
|
|
28
|
+
|
|
29
|
+
/* The <768px breakpoint re-sets --font-size / --gap* from these mobile
|
|
30
|
+
tokens with !important. On the web that is comfort on a phone; in an
|
|
31
|
+
app it means text GROWS when the window shrinks. Point the mobile
|
|
32
|
+
tokens at the desktop values so the breakpoint becomes a no-op.
|
|
33
|
+
(Gap formulas are duplicated rather than var(--gap)-referenced —
|
|
34
|
+
referencing the token they feed would create a custom-property cycle.) */
|
|
35
|
+
--font-size-mobile: var(--font-text-size);
|
|
36
|
+
--gap-mobile: calc(var(--space) * var(--optical-ratio));
|
|
37
|
+
--gap-body-mobile: var(--space-2);
|
|
38
|
+
--gap-header-mobile: var(--space-8);
|
|
39
|
+
|
|
40
|
+
/* Tighter modular scale than the silver default — in an app, headings
|
|
41
|
+
are labels and section chrome, not display type. */
|
|
42
|
+
--font-ratio: 1.333;
|
|
43
|
+
|
|
44
|
+
/* ---- Motion ----------------------------------------------------------
|
|
45
|
+
The framework's durations (350 / 500 / 1000ms) are paced for a page
|
|
46
|
+
settling under your eyes. Chrome has to feel immediate under the
|
|
47
|
+
cursor. Same names, so components stay themeable from one place. */
|
|
48
|
+
--duration-instant: 120ms;
|
|
49
|
+
--duration-fast: 150ms;
|
|
50
|
+
--duration-standard: 180ms;
|
|
51
|
+
--duration-slow: 300ms;
|
|
52
|
+
|
|
53
|
+
/* ---- Radius ----------------------------------------------------------
|
|
54
|
+
The framework derives --radius from --leading, a TYPOGRAPHIC rhythm
|
|
55
|
+
value (~2.6px at 13px / 1.2), not a chrome corner. --corner is the
|
|
56
|
+
framework's own escape hatch for exactly this.
|
|
57
|
+
--radius-sm is set explicitly: the framework's min(8px, --radius)
|
|
58
|
+
would collapse onto --radius and stop being a distinct step.
|
|
59
|
+
--radius-lg has no framework equivalent; declared here so it is real. */
|
|
60
|
+
--corner: 6px; /* feeds --radius */
|
|
61
|
+
--radius-sm: 4px;
|
|
62
|
+
--radius-lg: 12px;
|
|
63
|
+
|
|
64
|
+
/* ---- Window chrome ---------------------------------------------------
|
|
65
|
+
A pane floating inside the window (a sidebar, an inspector) sits
|
|
66
|
+
--window-inset from the edge, and its corner is CONCENTRIC with the
|
|
67
|
+
window's: same centre, so radius = window radius − inset. That is the
|
|
68
|
+
rule macOS follows for its own inset sidebars; a pane radius picked
|
|
69
|
+
on its own never lines up with the window corner around it.
|
|
70
|
+
|
|
71
|
+
--window-radius is the one number that has to match the OS, and Apple
|
|
72
|
+
does not publish it: the HIG gives the concentric RULE (WWDC25, "Build
|
|
73
|
+
an AppKit app with the new design"), and native code gets it for free
|
|
74
|
+
(SwiftUI ConcentricRectangle / containerShape), but a web view has to
|
|
75
|
+
be told. MEASURED 2026-09-23 on Darwin 27 (the macOS after Tahoe), from Reveal's own window
|
|
76
|
+
(screencapture -o, circle fit on the corner's alpha edge): 17pt. That
|
|
77
|
+
is the titlebar-only radius. A window with an NSToolbar gets a larger
|
|
78
|
+
one; an app that has one should override this token, not the panes. */
|
|
79
|
+
--window-radius: 17px;
|
|
80
|
+
--window-inset: 8px;
|
|
81
|
+
--pane-radius: calc(var(--window-radius) - var(--window-inset));
|
|
82
|
+
|
|
83
|
+
/* The title-bar band, from the window's top edge. Everything that sits
|
|
84
|
+
beside the traffic lights (sidebar icons, wordmark, toolbar) centres in
|
|
85
|
+
this band, so it lines up with them. The lights are placed by macOS,
|
|
86
|
+
so this is MEASURED, not chosen: their centre sits 20.75pt below the
|
|
87
|
+
window top (same capture as --window-radius), band = twice that. */
|
|
88
|
+
--titlebar-height: 41.5px;
|
|
89
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stnd/styles",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.1",
|
|
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",
|