@stnd/styles 0.5.1 → 0.5.3
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/LICENSE +21 -0
- package/README.md +117 -21
- package/TOKENS.md +26 -4
- package/_standard-00-reset.scss +64 -5
- package/_standard-00-variables.scss +39 -11
- package/_standard-01-token.scss +324 -28
- package/_standard-02-color.scss +208 -86
- package/_standard-03-typography.scss +88 -121
- package/_standard-04-grid.scss +31 -30
- package/_standard-05-rhythm.scss +43 -0
- package/_standard-06-prose.scss +28 -40
- package/_standard-07-base.scss +44 -34
- package/_standard-08-media.scss +42 -29
- package/_standard-09-lists.scss +72 -17
- package/_standard-10-tables.scss +51 -3
- package/_standard-11-forms.scss +43 -10
- package/_standard-12-code.scss +84 -2
- package/_standard-13-components.scss +63 -33
- package/_standard-14-analog.scss +30 -4
- package/_standard-30-contrast.scss +20 -7
- package/_standard-31-print.scss +28 -1
- package/_standard-32-eink.scss +30 -3
- package/_standard-50-utilities.scss +39 -38
- package/_standard-99-debug.scss +25 -18
- package/obsidian.scss +5 -4
- package/package.json +5 -8
- package/standard.scss +11 -5
- package/dist/obsidian.css +0 -31
- package/dist/obsidian.css.map +0 -1
- package/dist/standard.css +0 -20
- package/dist/standard.css.map +0 -1
package/CHANGELOG.md
CHANGED
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Francis Fontaine
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,16 +1,36 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "@stnd/styles"
|
|
3
|
-
|
|
3
|
+
aliases: []
|
|
4
|
+
created: 2026-07-04 23:27
|
|
5
|
+
modified: 2026-09-16T18:33:44.496Z
|
|
6
|
+
last_audited: 2026-07-14
|
|
7
|
+
audit_interval_days: 90
|
|
8
|
+
next_audit: 2026-10-12
|
|
9
|
+
audit_priority: 3
|
|
4
10
|
maturity: tree
|
|
5
|
-
|
|
11
|
+
mode: read
|
|
12
|
+
publish: true
|
|
13
|
+
status: active
|
|
6
14
|
tags:
|
|
7
15
|
- package
|
|
8
16
|
- stnd
|
|
17
|
+
theme: kernel
|
|
18
|
+
type: package
|
|
19
|
+
visibility: public
|
|
20
|
+
garden-url: https://standard.garden/@francis/readme
|
|
21
|
+
garden-short: https://stnd.gd/Yl18ps
|
|
22
|
+
permalink: readme
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
# @[stnd](../README)/styles
|
|
26
|
+
|
|
27
|
+
> The CSS typography and design system framework for the Standard Ecosystem.
|
|
28
|
+
|
|
9
29
|
---
|
|
10
30
|
|
|
11
|
-
|
|
31
|
+
This is the CSS. One seed color in, a whole harmonious palette out; one base font size in, a whole readable type scale out. You almost never touch this package directly — it’s on automatically (see `@stnd/modules/styles` in the Gold Standard). You touch it when you want to *change* the numbers behind the look (the golden-ratio scale, the OKLCH color math) rather than a specific theme’s colors (that’s `@stnd/themes`).
|
|
12
32
|
|
|
13
|
-
|
|
33
|
+
**You’re already using it.** Nothing to install or configure for a normal site.
|
|
14
34
|
|
|
15
35
|
## Overview
|
|
16
36
|
|
|
@@ -22,9 +42,9 @@ The CSS typography and design system framework for the Standard Ecosystem.
|
|
|
22
42
|
|
|
23
43
|
The system rejects arbitrary pixel coordinates. All spacing, font scaling, and line heights are tied to three mathematical constants:
|
|
24
44
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
45
|
+
- **Golden Ratio** ($\phi \approx 1.618$): Governs structural widths, block margins, and main layout columns.
|
|
46
|
+
- **Silver Ratio** ($\theta \approx 1.414$): Governs the typographic scale and base vertical rhythm.
|
|
47
|
+
- **Halfstep** ($\sqrt{\phi} \approx 1.272$): Square root of the Golden Ratio, used for subheadings, margins, and inline gaps.
|
|
28
48
|
|
|
29
49
|
---
|
|
30
50
|
|
|
@@ -49,12 +69,12 @@ Standard applies a strict modular font scale to prevent typographic clashes. Bod
|
|
|
49
69
|
|
|
50
70
|
Vertical rhythm is managed through a base unit `--space` (usually $1\text{rem}$ / $16\text{px}$). Multiples and fractions are locked:
|
|
51
71
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
72
|
+
- **Standard Spacing (Multiples)**:
|
|
73
|
+
- `--space-2`, `--space-4`, `--space-8`, `--space-12`
|
|
74
|
+
- **Sub-units (Fractions)**:
|
|
75
|
+
- `--space-half` (0.5x), `--space-third` (0.33x), `--space-d4` (0.25x), `--space-d8` (0.125x)
|
|
56
76
|
|
|
57
|
-
Elements align to this grid through a strict rule: *the sum of an element
|
|
77
|
+
Elements align to this grid through a strict rule: *the sum of an element’s font-size, line-height, and margins must always be a multiple of `--space`.*
|
|
58
78
|
|
|
59
79
|
---
|
|
60
80
|
|
|
@@ -74,9 +94,9 @@ Instead of hardcoding colors, the system generates complete color palettes dynam
|
|
|
74
94
|
|
|
75
95
|
Specialized styling rules load automatically depending on document attributes:
|
|
76
96
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
97
|
+
- **Prose Mode** (`.prose`): Restricts reading width to an optimal measure ($\approx 65\text{ch}$) to prevent eye strain.
|
|
98
|
+
- **Dark Mode**: Evaluated via system settings (`prefers-color-scheme`) or overridden with the `.theme-dark` class.
|
|
99
|
+
- **E-Ink Mode** (`.standard-eink`): Strips out all transforms, blurs, and animations, switching colors to pure high-contrast black and white to prevent ghosting on e-readers.
|
|
80
100
|
|
|
81
101
|
---
|
|
82
102
|
|
|
@@ -86,9 +106,11 @@ In your main SCSS stylesheet or Astro entry point:
|
|
|
86
106
|
|
|
87
107
|
```scss
|
|
88
108
|
// Load standard variables and layouts
|
|
89
|
-
|
|
109
|
+
@use "@stnd/styles/standard.scss";
|
|
90
110
|
```
|
|
91
111
|
|
|
112
|
+
> Most apps never need this — the Gold Standard `@stnd/modules/styles` module injects the stylesheet automatically. Import it manually only when composing your own SCSS entry point.
|
|
113
|
+
|
|
92
114
|
### Style Files Anatomy
|
|
93
115
|
- `standard.scss`: Framework index.
|
|
94
116
|
- `_standard-01-token.scss`: Variable dictionary.
|
|
@@ -100,17 +122,91 @@ import "@stnd/styles/standard.scss";
|
|
|
100
122
|
|
|
101
123
|
---
|
|
102
124
|
|
|
103
|
-
##
|
|
104
|
-
|
|
105
|
-
|
|
125
|
+
## Notes / Observations
|
|
126
|
+
|
|
127
|
+
*(jot down anything noticed here — quirks, gotchas, ideas)*
|
|
128
|
+
|
|
129
|
+
### Audit log (2026-07-14 → ongoing)
|
|
130
|
+
|
|
131
|
+
File-by-file pass, adding WHY-comments and checking for cascade/scope bugs. Fixed vs. flagged-only noted per item.
|
|
132
|
+
|
|
133
|
+
**Fixed:**
|
|
134
|
+
- **`$stnd-scope: ":root, body"` silently blocked frontmatter overrides.**
|
|
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.
|
|
136
|
+
- **`$stnd-scope` vs `$stnd-theme-scope`** — two SCSS variables, always set
|
|
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).
|
|
138
|
+
- **`$elements-boxed`** (`_standard-00-variables.scss`) — defined, never
|
|
139
|
+
consumed anywhere. Deleted.
|
|
140
|
+
- **Duplicate `--ease-aggressive`** — identical value declared twice in
|
|
141
|
+
`_standard-01-token.scss`. Deleted the redundant copy.
|
|
142
|
+
- **`$mobile` docblock drift** — comment claimed `480px`, actual value is
|
|
143
|
+
`600px` (confirmed correct). Comment fixed to match code.
|
|
144
|
+
- **`obsidian.scss` docblock drift** — claimed tokens live "inside :root";
|
|
145
|
+
actually scoped to `body.stnd-adapter` (deliberately, for namespacing in Obsidian's shared window). Comment corrected.
|
|
146
|
+
- **`body`'s own dead `--max-width` fallback** (`_standard-07-base.scss`)
|
|
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).
|
|
148
|
+
- **Garbled leftover comment** (`_standard-07-base.scss`) — a `[id]`
|
|
149
|
+
block's comment repeated the same incomplete CSS fragment (`background: var(--color-surface-highest);`) four times, pure noise. Replaced with an actual explanation of what `scroll-margin-top` there is for (keeps anchor-linked headings clear of the sticky header).
|
|
150
|
+
- **`.negate-body-padding*` docblock described a nonexistent API**
|
|
151
|
+
(`_standard-07-base.scss`) — those three class names, and the usage example, don't match the real implementation (`.no-body-margin`, and far more restrictive: only `<footer>`/`<header>` that are direct children of `<body>` and first/last-of-type). Neither name is used anywhere in `apps/` today, so nothing broke in practice, but the docs would have misled whoever reached for it next. Rewrote to match reality.
|
|
152
|
+
- **Duplicate identical `font-family` on `select`** (`_standard-11-forms.scss`)
|
|
153
|
+
— same line twice, zero behavior difference either way. Removed one.
|
|
154
|
+
- **Stale file reference** (`_standard-12-code.scss`) — comment pointed to
|
|
155
|
+
`standard-98-utilities.scss`, which doesn't exist; real file is `_standard-50-utilities.scss`. Corrected.
|
|
156
|
+
- **`.bg-surface` defined three times, identically** (`_standard-50-utilities.scss`) — same declaration, zero behavior difference. Consolidated to one; verified the computed color is unchanged.
|
|
157
|
+
|
|
158
|
+
**Fixed — round 2 (2026-07-14, same day, follow-up pass on everything round 1 had flagged):**
|
|
159
|
+
Every flagged item below got fixed except three, which are real judgment calls and stayed open on purpose (see the next section). Grouped by file:
|
|
160
|
+
- `_standard-01-token.scss`: `--z-launher` → `--z-launcher` (typo fixed; still unused, but spelled correctly).
|
|
161
|
+
- `_standard-02-color.scss`: dark-mode purple/pink/brown now reassign to their `--color-dark-*` counterparts (in both the `prefers-color-scheme: dark` block and the `[data-color-mode="dark"]` blocks); added the missing Stage 8 non-OKLCH fallback hex for all three; deleted the dead `0 solid transparent` `--border` line (kept `none` — see deferred items, the *value* wasn't touched); collapsed `--shadow`'s duplicated `--shadow-ambient` layer to one.
|
|
162
|
+
- `_standard-03-typography.scss`: `grid-line-height` mixin now reads `var(--font-header-line-height, ...)` instead of ignoring the token outright — headings actually respond to the frontmatter token now; deleted the dead hardcoded second `.font-interface` block.
|
|
163
|
+
- `_standard-04-grid.scss`: deleted the dead `--grid-gap` copy of `.grid.compact`/`.relaxed`; replaced every `[class^="grid-"]`/`[class|="grid"]` attribute selector with an explicit, order-independent `$grid-selectors` list (confirmed fix against real markup: `apps/stnd.build/modules/core/routes/index.astro`'s `class="cover grid-12"`).
|
|
164
|
+
- `_standard-06-prose.scss`: `.mycelial-graft` now uses real tokens (`--color-muted`, `--color-accent`, `--color-surface-high`); deleted the stale `h1:first-child` comment.
|
|
165
|
+
- `_standard-07-base.scss`: mobile header padding-negation now sets `margin-block-start` (matching the desktop rule and the footer's symmetric block), not `margin-block-end`.
|
|
166
|
+
- `_standard-08-media.scss`: deleted the dead `--gap-body` padding line on `.image-zoom-overlay`; hardcoded `768px` → `#{$small}`.
|
|
167
|
+
- `_standard-09-lists.scss` / `_standard-50-utilities.scss`: removed all 5 dead `--base-gap` lines; `.display-flex` → `.flex` (the real class).
|
|
168
|
+
- `_standard-10-tables.scss`: `min-height: var(--line-height)` (invalid, unitless) → `min-height: calc(1em * var(--line-height-compact))`.
|
|
169
|
+
- `_standard-11-forms.scss`: `--color-on-cce` typo → `--color-on-accent`; deleted the flat `background` override that was silently killing "THE FILL MAGIC" slider gradient (confirmed live: `Slider.astro` sets `--slider-value` via JS), added a `50%` fallback to both gradient stops.
|
|
170
|
+
- `_standard-13-components.scss`: deleted the pointless `@each $type` badge loop (zero effect on output); `--alert-border-color` → `--color-alert`.
|
|
171
|
+
- `_standard-14-analog.scss`: hardcoded `z-index: 9999` → `var(--z-image-zoom)`.
|
|
172
|
+
- `_standard-30-contrast.scss` / `_standard-32-eink.scss`: added `html::after` to both grain-hiding selector lists (the overlay actually lives there, not on `body::before/after`).
|
|
173
|
+
- `_standard-31-print.scss`: dead `--body-padding` → real `--gap-body`/`--gap-header`/`--gap-footer` overrides.
|
|
174
|
+
- `_standard-32-eink.scss`: added the missing `@use "standard-00-variables" as *;`; `.card, .button, .image` → `.card, :where(button), a.btn, img` (real selectors); `--text-accent` → `--color-accent`.
|
|
175
|
+
- `_standard-50-utilities.scss`: `.line-s`/`.line-l`/`.columns-auto` → `--line-width-sm`/`--line-width-lg`; `.purple`/`.pink`/`.bg-purple`/`.bg-pink` → their real distinct tokens (no longer both rendering as magenta); `@supports not (display: grid)` fallback → `var(--gap)`; deleted the dead `[class|="columns"].compact`/`.relaxed` pair; removed dead `--color-msg` lines from all 4 alert variants.
|
|
176
|
+
- `_standard-99-debug.scss`: `--gap-grid` (undefined) → `var(--gap)` everywhere (the debug overlay's own column math now actually works); `--z-tooltip` (undefined) → hardcoded `10000` matching the file's own baseline.
|
|
177
|
+
|
|
178
|
+
All 17 files verified via a running dev server (both `stnd.gd` and `stnd.build`): zero compile errors, pixel-identical baseline screenshots, plus targeted computed-style spot-checks on the trickiest fixes (purple/pink/brown dark-mode switching, the grid attribute-selector fix against real production markup, the slider gradient rendering, `--font-header-line-height` genuinely driving heading line-height).
|
|
179
|
+
|
|
180
|
+
**Flagged — deliberately left as judgment calls, not bugs to silently fix:**
|
|
181
|
+
- **`--border` currently resolves to `none` sitewide** (`_standard-02-color.scss`) — affects cards, buttons, inputs, tables. The dead duplicate declaration is gone, but the final value was left alone: making it visible would be a real, sitewide visual design change (dozens of components), not a bug fix.
|
|
182
|
+
- **`.rhythm`'s base 1x-spacing rule has no `>` combinator; every other rule in the same block does** (`_standard-05-rhythm.scss`) — applies at any nesting depth instead of direct children only. Left alone: adding `>` risks a real regression on nested content (e.g. a paragraph inside a `.callout` inside `.rhythm`) that's impossible to fully rule out without a visual pass over every place `.rhythm` is used.
|
|
183
|
+
- **`.compact`/`.relaxed` are unnamespaced and collide across `_standard-09-lists.scss` and `_standard-50-utilities.scss`** — resolving this properly means renaming part of the framework's public class API, which is an architectural decision, not a mechanical fix.
|
|
184
|
+
|
|
185
|
+
**Documented, not a bug:**
|
|
186
|
+
- The `generate-scale` mixin's `"trim"`/`"leading"` scale keys (feeding `.mt-trim`, `.p-leading`, etc.) use `--size-2xs`/`--size-xs` — not the real `--trim`/`--leading` rhythm tokens that happen to share the same words. `.mt-trim` does not use `--trim`. A naming collision worth knowing about, not something to change.
|
|
187
|
+
|
|
188
|
+
**Where the mechanism is real but the hook is currently unused:**
|
|
189
|
+
- `--corner` (theme override for `--radius`) — documented, no theme sets
|
|
190
|
+
it yet. Not dead, just unclaimed.
|
|
191
|
+
|
|
192
|
+
### How to keep this going
|
|
193
|
+
|
|
194
|
+
Batches (see `packages/styles/*.scss`, foundation → layout → elements → components → modes → utilities): work through in dependency order, add WHY-comments for anything non-obvious, append findings above as they surface. Ask before silently fixing anything with real blast radius; docblock drift / dead code / pure redundancy are safe to just fix inline.
|
|
195
|
+
|
|
196
|
+
**Gotcha for whoever writes the comments**: Sass block comments (`/* */`) are interpolation-aware — `#{$i}` (or any `#{...}`) written literally inside a comment, describing a `@for` loop's output, gets evaluated as real Sass and breaks the build with "Undefined variable" if that variable isn't in scope at the comment's location. Learned this the hard way auditing `_standard-04-grid.scss` (2026-07-14) — write `.grid-N`, not `.grid-#{$i}`, when a comment needs to describe generated class names.
|
|
197
|
+
|
|
198
|
+
## Todo
|
|
199
|
+
|
|
200
|
+
- [x] **CSS framework audit / cleanup** *(completed 2026-07-14 — all 8 batches, foundation through utilities/debug, plus a same-day round-2 fix pass — see Audit log above. ~15 items fixed inline during the audit itself, then ~33 more of the ~36 flagged findings fixed in round 2 (undefined/typo'd custom properties, dead code, the grid attribute-selector footgun, several "duplicate declaration silently kills the first" cases). 3 left as deliberate judgment calls (`--border`'s value, `.rhythm`'s missing `>` combinator, `.compact`/`.relaxed` naming collision) — real behavior/API changes, not obviously safe to auto-fix. Every edit verified against a running dev server on both `stnd.gd` and `stnd.build`; nothing here changed the site's actual rendered output except the two root-cause bugs fixed early on (the `:root, body` scope bug and its `--max-width` cleanup) and the intentional restorations listed above (e.g. `--font-header-line-height` and the slider gradient now actually work).)*
|
|
201
|
+
- [ ] Feeds into the future theme creation/editing UX (see `@stnd/themes` Todo) — that UX will need to expose these tokens live. [priority:: 3] [token_scale:: 3] [created:: 2026-07-14] [area:: framework]
|
|
106
202
|
|
|
107
203
|
---
|
|
108
204
|
|
|
109
205
|
## 🔗 Liens & Normes
|
|
110
206
|
|
|
111
|
-
Ce paquet de styles implémente la charte visuelle et les tokens de l
|
|
207
|
+
Ce paquet de styles implémente la charte visuelle et les tokens de l’écosystème Standard. Pour plus de détails sur les spécifications graphiques et de code, consultez :
|
|
112
208
|
- **Architecture Système** : [4.1 Architecture](../../apps/stnd.build/modules/manual/content/4-system/4.1-architecture.md)
|
|
113
209
|
- **Principes de Code** : [4.2 Code Standards](../../apps/stnd.build/modules/manual/content/4-system/4.2-code-standards.md)
|
|
114
210
|
- **Normes de Documentation** : [4.9 Normes README](../../apps/stnd.build/modules/manual/content/4-system/4.9-readme-standard.md)
|
|
115
|
-
- **
|
|
211
|
+
- **Le Standard** : [packages/README.md](../README.md)
|
|
116
212
|
- **Charte Graphique** : [3.1 Color System](../../apps/stnd.build/modules/manual/content/3-graphics/3.1-color-system.md) et [3.2 Typography](../../apps/stnd.build/modules/manual/content/3-graphics/3.2-typography-and-typefaces.md)
|
package/TOKENS.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
aliases: []
|
|
3
|
+
created: 2026-03-16 08:07
|
|
4
|
+
modified: 2026-09-16T18:33:41.605Z
|
|
5
|
+
mode: read
|
|
6
|
+
publish: true
|
|
7
|
+
tags: []
|
|
8
|
+
theme:
|
|
9
|
+
type: note
|
|
10
|
+
visibility: public
|
|
11
|
+
garden-url: https://standard.garden/@francis/tokens
|
|
12
|
+
permalink: tokens
|
|
13
|
+
garden-short: https://stnd.gd/jb29Tu
|
|
14
|
+
---
|
|
15
|
+
|
|
1
16
|
# Standard Design Tokens
|
|
2
17
|
|
|
3
18
|
> Canonical reference for all CSS custom properties exposed by `@stnd/styles`.
|
|
@@ -32,7 +47,6 @@ For example, `foreground: "#1a1a1a"` becomes `--foreground: #1a1a1a`. See `packa
|
|
|
32
47
|
| `--leading` | `calc((line-height - 1) * font-size)` | Space between cap-height and next baseline |
|
|
33
48
|
| `--nl` | `calc(leading * line-height)` | Newline — full vertical unit |
|
|
34
49
|
| `--trim` | `calc(leading / 2)` | Half-leading trim |
|
|
35
|
-
| `--max-width` | `1024px` | Maximum content width |
|
|
36
50
|
| `--font-size-mobile` | `1.1rem` | Font size override on mobile |
|
|
37
51
|
|
|
38
52
|
## Spacing Scale
|
|
@@ -83,10 +97,18 @@ Powered by `pow(var(--optical-ratio), N)`.
|
|
|
83
97
|
| `--size-5xl` | `--scale-7` |
|
|
84
98
|
| `--size-6xl` | `--scale-8` |
|
|
85
99
|
|
|
86
|
-
##
|
|
100
|
+
## Layout Widths
|
|
101
|
+
|
|
102
|
+
Two independent scopes. `.prose`'s own box reads `--body-max-width`
|
|
103
|
+
directly, so `.hero`/`.full` breakout elements grow all the way to the page
|
|
104
|
+
shell. `.feature` and tables/`.editorial` don't reference either width
|
|
105
|
+
token — they break out by a fixed rhythm increment off `--line-width`
|
|
106
|
+
(`--space-2` / `--space-4` each side).
|
|
87
107
|
|
|
88
108
|
| Token | Default | Description |
|
|
89
109
|
| ------------------- | --------------------------------- | --------------------------------------------- |
|
|
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 |
|
|
90
112
|
| `--line-width-xs` | `24rem` | Extra small |
|
|
91
113
|
| `--line-width-sm` | `32rem` | Small |
|
|
92
114
|
| `--line-width-md` | `42rem` | Medium (default reading width) |
|
|
@@ -318,8 +340,8 @@ box-shadow: var(--shadow-inset), var(--shadow-ambient);
|
|
|
318
340
|
|
|
319
341
|
| Token | Default | Description |
|
|
320
342
|
| ---------------------- | ------------------------------- | ------------------ |
|
|
321
|
-
| `--tooltip-background` |
|
|
322
|
-
| `--tooltip-text` |
|
|
343
|
+
| `--tooltip-background` | `var(--color-dark, #1a1a1a)` | Tooltip background |
|
|
344
|
+
| `--tooltip-text` | `var(--color-light, #ffffff)` | Tooltip text |
|
|
323
345
|
| `--tooltip-ease` | `cubic-bezier(0.25, 1, 0.5, 1)` | Tooltip animation |
|
|
324
346
|
|
|
325
347
|
---
|
package/_standard-00-reset.scss
CHANGED
|
@@ -1,8 +1,30 @@
|
|
|
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
|
/* =========================== */
|
|
4
22
|
|
|
5
23
|
/* Disable view transition animations - instant page swaps
|
|
24
|
+
Superseded by the fade in/out ::view-transition-old(root) /
|
|
25
|
+
::view-transition-new(root) rules in _standard-01-token.scss — kept here
|
|
26
|
+
commented out as the "instant, no animation" alternative if that fade
|
|
27
|
+
is ever reverted.
|
|
6
28
|
::view-transition {
|
|
7
29
|
animation-duration: 0s !important;
|
|
8
30
|
}
|
|
@@ -22,19 +44,48 @@
|
|
|
22
44
|
scrollbar-width: thin;
|
|
23
45
|
}
|
|
24
46
|
|
|
25
|
-
/*
|
|
47
|
+
/*
|
|
26
48
|
* Modern targeted reset (replaces the old `* { margin: 0; padding: 0 }`).
|
|
27
|
-
* This prevents the framework from destroying the native margins/paddings of complex
|
|
28
|
-
* embedded editors (like CodeMirror/Obsidian) or third-party web widgets, while still
|
|
49
|
+
* This prevents the framework from destroying the native margins/paddings of complex
|
|
50
|
+
* embedded editors (like CodeMirror/Obsidian) or third-party web widgets, while still
|
|
29
51
|
* perfectly resetting the standard web typography and layout elements.
|
|
30
52
|
*/
|
|
31
|
-
|
|
53
|
+
:where(
|
|
54
|
+
html,
|
|
55
|
+
body,
|
|
56
|
+
p,
|
|
57
|
+
ol,
|
|
58
|
+
ul,
|
|
59
|
+
li,
|
|
60
|
+
dl,
|
|
61
|
+
dt,
|
|
62
|
+
dd,
|
|
63
|
+
blockquote,
|
|
64
|
+
figure,
|
|
65
|
+
fieldset,
|
|
66
|
+
legend,
|
|
67
|
+
textarea,
|
|
68
|
+
pre,
|
|
69
|
+
iframe,
|
|
70
|
+
hr,
|
|
71
|
+
h1,
|
|
72
|
+
h2,
|
|
73
|
+
h3,
|
|
74
|
+
h4,
|
|
75
|
+
h5,
|
|
76
|
+
h6,
|
|
77
|
+
img,
|
|
78
|
+
span,
|
|
79
|
+
a
|
|
80
|
+
) {
|
|
32
81
|
margin: 0;
|
|
33
82
|
padding: 0;
|
|
34
83
|
border: 0 solid;
|
|
35
84
|
}
|
|
36
85
|
|
|
37
|
-
button,
|
|
86
|
+
button,
|
|
87
|
+
input,
|
|
88
|
+
select {
|
|
38
89
|
margin: 0;
|
|
39
90
|
}
|
|
40
91
|
|
|
@@ -54,6 +105,8 @@ object {
|
|
|
54
105
|
display: block;
|
|
55
106
|
vertical-align: middle;
|
|
56
107
|
}
|
|
108
|
+
/* inline-block, not block like img/video above — svgs are used inline
|
|
109
|
+
within text/buttons/icons far more often than as standalone media. */
|
|
57
110
|
svg {
|
|
58
111
|
display: inline-block;
|
|
59
112
|
vertical-align: middle;
|
|
@@ -65,10 +118,16 @@ video {
|
|
|
65
118
|
height: auto;
|
|
66
119
|
}
|
|
67
120
|
|
|
121
|
+
/* [hidden] forced off, but hidden="until-found" is deliberately excluded —
|
|
122
|
+
that's the browser's native find-in-page reveal mechanism (Ctrl/Cmd+F);
|
|
123
|
+
force-hiding it here would break the browser's ability to un-hide it. */
|
|
68
124
|
[hidden]:where(:not([hidden="until-found"])) {
|
|
69
125
|
display: none !important;
|
|
70
126
|
}
|
|
71
127
|
|
|
128
|
+
/* Browsers never render <script> content by default — this guards against
|
|
129
|
+
some other broad selector (a component lib, a CMS export) accidentally
|
|
130
|
+
setting display on everything and making inline script text visible. */
|
|
72
131
|
script {
|
|
73
132
|
display: none !important;
|
|
74
133
|
}
|
|
@@ -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
|
-
* @
|
|
9
|
-
* @
|
|
10
|
-
* @
|
|
11
|
-
* @
|
|
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
|
-
* //
|
|
20
|
-
*
|
|
21
|
-
*
|
|
26
|
+
* // Extending surface placeholder
|
|
27
|
+
* .my-panel {
|
|
28
|
+
* @extend %surface;
|
|
22
29
|
* }
|
|
23
30
|
*
|
|
24
31
|
* @since 0.1.0
|
|
@@ -30,14 +37,26 @@ $small: 768px;
|
|
|
30
37
|
$large: 1024px;
|
|
31
38
|
$wide: 1440px;
|
|
32
39
|
|
|
40
|
+
// Text elements needing text-box-trim (removes leading/trailing font
|
|
41
|
+
// ascender/descender space so line-height math lines up with the baseline
|
|
42
|
+
// grid) — consumed once in _standard-01-token.scss's #{$text-elements} rule.
|
|
33
43
|
$text-elements: "a, kbd, div, span, mark, callout-title::before, span, li::before, button, legend, fieldset, label, li, h1, h2, h3, h4, h5, h6, p:not(:has(img)), figcaption, dt, dd, label, td, th, .callout, code, .lined, aside";
|
|
34
44
|
|
|
45
|
+
// Vertical rhythm system (_standard-05-rhythm.scss): consecutive "simple"
|
|
46
|
+
// elements get 1x --gap margin between them; the moment either neighbor is
|
|
47
|
+
// a "double" (heavier block-level: tables, cards, figures, sections...) the
|
|
48
|
+
// margin becomes --gap * --gap-multiplicator (2x by default) — extra
|
|
49
|
+
// breathing room around visually heavier blocks. $rhythm-tags is the union,
|
|
50
|
+
// used for the heading-follows-anything spacing rules.
|
|
35
51
|
$rhythm-simple-tags: ".alert, #comments, h1, h2, h3, h4, h5, h6, blockquote, ul, ol, li, dl, dt, dd, p, pre, figure, hr, form, fieldset, button, aside, .callout, .card, .box, .btn, .grid";
|
|
36
52
|
$rhythm-double-tags: "table, blockquote, div:has(.video), section, article, header, footer, hr, #comments, .callout, pre, figure, p:has(img), section, .box, .card, .small, .editorial, .feature, .hero, .full, .scroll, hr, aside, .stnd-code-block";
|
|
37
53
|
$rhythm-tags: $rhythm-simple-tags + ", div, " + $rhythm-double-tags;
|
|
38
54
|
|
|
39
|
-
|
|
40
|
-
|
|
55
|
+
// Reusable style fragments via @extend (not applied directly — SCSS
|
|
56
|
+
// placeholder selectors emit no CSS of their own until extended).
|
|
57
|
+
// %surface: card/panel look — _standard-13-components.scss.
|
|
58
|
+
// %padding-text: form-control text padding — _standard-11-forms.scss,
|
|
59
|
+
// _standard-13-components.scss.
|
|
41
60
|
%surface {
|
|
42
61
|
border: none;
|
|
43
62
|
/* Raised effect for all surfaces */
|
|
@@ -50,5 +69,14 @@ $elements-boxed: "blockquote, pre, .alert, aside, .card, .callout, img, iframe,
|
|
|
50
69
|
padding: var(--space-d4) var(--space-d2);
|
|
51
70
|
}
|
|
52
71
|
|
|
53
|
-
|
|
72
|
+
// Single-target on purpose (not ":root, body") — a token declared on both
|
|
73
|
+
// would always win on <body>'s own cascade resolution over anything set at
|
|
74
|
+
// :root/html, silently blocking any :root-only override (which is exactly
|
|
75
|
+
// what a note's frontmatter inlineStyle produces). See _standard-01-token.scss.
|
|
76
|
+
//
|
|
77
|
+
// Used to be two variables ($stnd-scope + $stnd-theme-scope) with different
|
|
78
|
+
// defaults (":root, body" vs ":root"). Consolidated to one (2026-07-14) once
|
|
79
|
+
// $stnd-scope became single-target too — nothing ever set them to different
|
|
80
|
+
// selectors (obsidian.scss configures both identically), so the split was
|
|
81
|
+
// pure redundancy.
|
|
54
82
|
$stnd-theme-scope: ":root" !default;
|