@stnd/styles 0.5.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 +25 -0
- package/README.md +116 -0
- package/TOKENS.md +415 -0
- package/_standard-00-reset.scss +74 -0
- package/_standard-00-variables.scss +54 -0
- package/_standard-01-token.scss +287 -0
- package/_standard-02-color.scss +683 -0
- package/_standard-03-typography.scss +411 -0
- package/_standard-04-grid.scss +314 -0
- package/_standard-05-rhythm.scss +57 -0
- package/_standard-06-prose.scss +289 -0
- package/_standard-07-base.scss +216 -0
- package/_standard-08-media.scss +216 -0
- package/_standard-09-lists.scss +103 -0
- package/_standard-10-tables.scss +49 -0
- package/_standard-11-forms.scss +343 -0
- package/_standard-12-code.scss +204 -0
- package/_standard-13-components.scss +1261 -0
- package/_standard-14-analog.scss +48 -0
- package/_standard-30-contrast.scss +42 -0
- package/_standard-31-print.scss +97 -0
- package/_standard-32-eink.scss +78 -0
- package/_standard-50-utilities.scss +1117 -0
- package/_standard-99-debug.scss +474 -0
- package/dist/obsidian.css +31 -0
- package/dist/obsidian.css.map +1 -0
- package/dist/standard.css +20 -0
- package/dist/standard.css.map +1 -0
- package/index.js +1 -0
- package/obsidian.scss +18 -0
- package/package.json +46 -0
- package/standard.scss +52 -0
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
@use "standard-00-variables" as *;
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @component Typography System
|
|
5
|
+
* @category Typography
|
|
6
|
+
* @description Fine-art typography system using variable fonts, OpenType features,
|
|
7
|
+
* and mathematical scaling. Implements classical typography rules with modern web capabilities.
|
|
8
|
+
* Supports multiple font families, optical sizing, and locale-specific rules.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#{$stnd-theme-scope} {
|
|
12
|
+
/* Font stacks */
|
|
13
|
+
--font-sans:
|
|
14
|
+
"Inter", "Instrument Sans Variable", system-ui, -apple-system, sans-serif;
|
|
15
|
+
--font-serif:
|
|
16
|
+
"Source Serif 4", "Newsreader", "Instrument Serif", "Source Serif 4", serif;
|
|
17
|
+
--font-monospace: "IBM Plex Mono", ui-monospace, monospace;
|
|
18
|
+
|
|
19
|
+
/* Semantic Font Roles */
|
|
20
|
+
--font-text: var(--font-sans);
|
|
21
|
+
--font-header: "Inter";
|
|
22
|
+
--font-interface: var(--font-sans);
|
|
23
|
+
|
|
24
|
+
/* OpenType Feature Sets */
|
|
25
|
+
--font-inter-feature: "calt", "cv05", "cv11", "ss03";
|
|
26
|
+
--font-instrument-feature: "figa", "ss01", "ss02", "ss05";
|
|
27
|
+
|
|
28
|
+
/* Font Axis Defaults */
|
|
29
|
+
--font-feature: "";
|
|
30
|
+
--font-variation: "wdth" 95;
|
|
31
|
+
--font-header-feature: "";
|
|
32
|
+
--font-header-variation: "";
|
|
33
|
+
--font-monospace-feature: "";
|
|
34
|
+
--font-monospace-variation: "";
|
|
35
|
+
|
|
36
|
+
/* Weight Scale */
|
|
37
|
+
--font-weight: 400;
|
|
38
|
+
--font-weight-bold: 600;
|
|
39
|
+
--font-letter-spacing: normal;
|
|
40
|
+
--font-header-letter-spacing: normal;
|
|
41
|
+
--font-header-line-height: 1;
|
|
42
|
+
--font-header-weight: 700;
|
|
43
|
+
|
|
44
|
+
/* Interface Tokens */
|
|
45
|
+
--font-interface-feature: "dlig", "zero";
|
|
46
|
+
--font-interface-variation: "";
|
|
47
|
+
--font-list-feature: "dlig", "tnum", "zero";
|
|
48
|
+
--font-list-variation: "";
|
|
49
|
+
|
|
50
|
+
/* Heading Weight Hierarchy */
|
|
51
|
+
--font-weight-h1: var(--font-header-weight);
|
|
52
|
+
--font-weight-h2: max(
|
|
53
|
+
calc(var(--font-header-weight) * 0.85),
|
|
54
|
+
var(--font-weight)
|
|
55
|
+
);
|
|
56
|
+
--font-weight-h3: max(
|
|
57
|
+
calc(var(--font-header-weight) * 0.85),
|
|
58
|
+
var(--font-weight)
|
|
59
|
+
);
|
|
60
|
+
--font-weight-h4: var(--font-weight);
|
|
61
|
+
--font-weight-h5: var(--font-weight);
|
|
62
|
+
--font-weight-h6: var(--font-weight);
|
|
63
|
+
|
|
64
|
+
--list-indent: var(--space);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* =========================== */
|
|
68
|
+
/* CORE ELEMENT STYLING */
|
|
69
|
+
/* =========================== */
|
|
70
|
+
|
|
71
|
+
html {
|
|
72
|
+
font-size: 100%;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
b,
|
|
76
|
+
strong,
|
|
77
|
+
.bold {
|
|
78
|
+
font-weight: var(--font-weight-bold, 600);
|
|
79
|
+
color: var(--color-bold);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
em {
|
|
83
|
+
color: var(--color-italic);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
:is(h1, h2, h3, h4, h5, h6) :is(b, strong, .bold) {
|
|
87
|
+
font-weight: inherit;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/* Headings Hierarchy */
|
|
91
|
+
h1,
|
|
92
|
+
h2,
|
|
93
|
+
h3,
|
|
94
|
+
h4,
|
|
95
|
+
h5,
|
|
96
|
+
h6 {
|
|
97
|
+
font-family: var(--font-header), system-ui, sans-serif;
|
|
98
|
+
color: var(--color-header);
|
|
99
|
+
text-wrap: balance;
|
|
100
|
+
font-variant-ligatures: normal;
|
|
101
|
+
font-feature-settings: var(--font-header-feature);
|
|
102
|
+
font-variation-settings: var(--font-header-variation);
|
|
103
|
+
font-style: var(--font-header-style, normal);
|
|
104
|
+
letter-spacing: var(--font-header-letter-spacing);
|
|
105
|
+
max-width: 100%;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
h1 {
|
|
109
|
+
font-weight: var(--font-weight-h1);
|
|
110
|
+
font-size: clamp(var(--size-xl), 5.5vw, var(--size-2xl));
|
|
111
|
+
line-height: var(--font-header-line-height, 1);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
h2 {
|
|
115
|
+
font-weight: var(--font-weight-h2);
|
|
116
|
+
font-size: clamp(var(--size-lg), 4vw, var(--size-xl));
|
|
117
|
+
line-height: var(--font-header-line-height, 1);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
h3 {
|
|
121
|
+
font-weight: var(--font-weight-h3);
|
|
122
|
+
font-size: clamp(var(--size-base), 3vw, var(--size-lg));
|
|
123
|
+
line-height: var(--font-header-line-height, 1);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
h4 {
|
|
127
|
+
font-weight: var(--font-weight);
|
|
128
|
+
font-size: var(--size-base);
|
|
129
|
+
line-height: var(--line-height);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
h5 {
|
|
133
|
+
font-weight: var(--font-weight);
|
|
134
|
+
font-size: var(--size-sm);
|
|
135
|
+
line-height: var(--line-height);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
h6 {
|
|
139
|
+
font-weight: var(--font-weight);
|
|
140
|
+
font-size: var(--size-xs);
|
|
141
|
+
line-height: var(--line-height);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* Typography Patterns */
|
|
145
|
+
.overline {
|
|
146
|
+
font-variant-caps: small-caps;
|
|
147
|
+
letter-spacing: 0.04em;
|
|
148
|
+
font-size: var(--size-sm);
|
|
149
|
+
border-top: var(--stroke-width) solid var(--color-border);
|
|
150
|
+
padding-block-start: var(--space-d2);
|
|
151
|
+
margin-block-end: var(--space);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/* Interaction */
|
|
155
|
+
a {
|
|
156
|
+
color: var(--color-link);
|
|
157
|
+
text-decoration: none;
|
|
158
|
+
text-decoration-thickness: var(--stroke-width);
|
|
159
|
+
text-underline-offset: calc(var(--stroke-width) * 2);
|
|
160
|
+
text-decoration-color: transparent;
|
|
161
|
+
box-shadow: none;
|
|
162
|
+
transition:
|
|
163
|
+
all var(--transition-fast),
|
|
164
|
+
text-decoration-color 0.5s cubic-bezier(0.4, 0, 0.2, 1);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
a:hover {
|
|
168
|
+
color: var(--color-accent);
|
|
169
|
+
text-decoration-color: var(--color-accent);
|
|
170
|
+
transition:
|
|
171
|
+
text-decoration-color var(--transition-fast),
|
|
172
|
+
color var(--transition);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
a[target="_blank"]:not(.internal-link)::after {
|
|
176
|
+
content: "↗";
|
|
177
|
+
display: inline-block;
|
|
178
|
+
font-size: var(--size-xs);
|
|
179
|
+
color: var(--color-subtle);
|
|
180
|
+
margin-inline-start: 0.2em;
|
|
181
|
+
transition: all var(--transition-fast);
|
|
182
|
+
text-decoration: none;
|
|
183
|
+
}
|
|
184
|
+
a[target="_blank"]:not(.internal-link):hover::after {
|
|
185
|
+
color: var(--color-link);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
[data-env="dev"] span.broken-link {
|
|
189
|
+
color: var(--color-error);
|
|
190
|
+
transition: all var(--transition-fast);
|
|
191
|
+
&::after {
|
|
192
|
+
content: "⊗";
|
|
193
|
+
font-size: var(--size-xs);
|
|
194
|
+
color: var(--color-error);
|
|
195
|
+
margin-inline-start: 0.2em;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
:is(h1, h2, h3, h4, h5, h6) a {
|
|
200
|
+
text-decoration: none;
|
|
201
|
+
&:hover {
|
|
202
|
+
text-decoration: none;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/* =========================== */
|
|
207
|
+
/* INTERFACE & CODE */
|
|
208
|
+
/* =========================== */
|
|
209
|
+
|
|
210
|
+
.menu,
|
|
211
|
+
.ui,
|
|
212
|
+
.interface,
|
|
213
|
+
.font-interface {
|
|
214
|
+
font-family: var(--font-interface), system-ui, sans-serif;
|
|
215
|
+
font-variation-settings: var(--font-interface-variation);
|
|
216
|
+
font-feature-settings: var(--font-interface-feature);
|
|
217
|
+
font-weight: var(--font-interface-weight, var(--font-weight));
|
|
218
|
+
font-size: var(--size-xs);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
code,
|
|
222
|
+
pre,
|
|
223
|
+
.font-mono {
|
|
224
|
+
font-family: var(--font-monospace), monospace;
|
|
225
|
+
font-feature-settings: var(--font-monospace-feature);
|
|
226
|
+
font-variation-settings: var(--font-monospace-variation);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.stnd-code-block {
|
|
230
|
+
position: relative;
|
|
231
|
+
background: var(--color-surface-low);
|
|
232
|
+
border-radius: var(--radius-sm);
|
|
233
|
+
box-shadow: var(--shadow-inset), var(--shadow-ring);
|
|
234
|
+
transition: all var(--transition);
|
|
235
|
+
|
|
236
|
+
pre {
|
|
237
|
+
margin: 0 !important;
|
|
238
|
+
background: transparent !important;
|
|
239
|
+
box-shadow: none !important;
|
|
240
|
+
border: none !important;
|
|
241
|
+
padding: var(--space-d2);
|
|
242
|
+
overflow-x: auto;
|
|
243
|
+
position: static;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
&:hover .copy-button {
|
|
247
|
+
opacity: 1;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.copy-button {
|
|
252
|
+
position: absolute;
|
|
253
|
+
top: var(--leading);
|
|
254
|
+
right: var(--leading);
|
|
255
|
+
opacity: 0;
|
|
256
|
+
|
|
257
|
+
&:hover {
|
|
258
|
+
opacity: 1 !important;
|
|
259
|
+
color: var(--color-on-accent);
|
|
260
|
+
background-color: var(--color-accent);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
&.copied {
|
|
264
|
+
color: var(--color-success, #22c55e) !important;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
&.failed {
|
|
268
|
+
color: var(--color-error, #ef4444) !important;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
pre {
|
|
273
|
+
line-height: var(--line-height-compact);
|
|
274
|
+
|
|
275
|
+
code {
|
|
276
|
+
opacity: 0.75;
|
|
277
|
+
transition: opacity var(--transition);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
&:hover code {
|
|
281
|
+
opacity: 1;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
blockquote {
|
|
286
|
+
font-style: italic;
|
|
287
|
+
color: var(--color-muted);
|
|
288
|
+
padding: var(--space);
|
|
289
|
+
border-left: var(--stroke-width-l) solid var(--color-border);
|
|
290
|
+
|
|
291
|
+
cite {
|
|
292
|
+
display: block;
|
|
293
|
+
margin-top: var(--space);
|
|
294
|
+
font-size: var(--scale-d2);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/* Utilities */
|
|
299
|
+
small {
|
|
300
|
+
font-size: var(--size-sm);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
sub,
|
|
304
|
+
sup {
|
|
305
|
+
font-size: var(--size-xs);
|
|
306
|
+
line-height: 0;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
sub {
|
|
310
|
+
vertical-align: sub;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
sup {
|
|
314
|
+
vertical-align: super;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
em {
|
|
318
|
+
color: var(--color-italic);
|
|
319
|
+
font-style: italic;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
.font-interface {
|
|
323
|
+
font-family: var(--font-interface), system-ui, sans-serif;
|
|
324
|
+
font-variation-settings: var(--font-interface-variation);
|
|
325
|
+
font-feature-settings: var(--font-interface-feature);
|
|
326
|
+
font-size: 12px;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* @component Design Tokens
|
|
331
|
+
* @category Foundation
|
|
332
|
+
* @description Primitive design tokens forming the foundation of the design system.
|
|
333
|
+
* Includes "Self-Aware" fluid typography that scales based on the Optical Ratio.
|
|
334
|
+
*/
|
|
335
|
+
|
|
336
|
+
#{$stnd-scope} {
|
|
337
|
+
/* ===== 2. THE META-COGNITION (Fluid Slopes) =====
|
|
338
|
+
Instead of magic numbers, we use the Ratio to determine "Physics".
|
|
339
|
+
|
|
340
|
+
Slope: (Ratio - 1).
|
|
341
|
+
- Golden (0.618) -> steep slope (fast growth).
|
|
342
|
+
- Silver (0.414) -> moderate slope.
|
|
343
|
+
*/
|
|
344
|
+
--physics-slope: calc(var(--optical-ratio) - 1);
|
|
345
|
+
|
|
346
|
+
/* Growth Factor: How aggressive is the resizing?
|
|
347
|
+
We multiply the slope by 1vw to create a viewport-relative unit. */
|
|
348
|
+
--fluid-growth: calc(var(--physics-slope) * 0.8vw);
|
|
349
|
+
|
|
350
|
+
/* Tension Factor: How much do we tighten leading as we grow?
|
|
351
|
+
Higher ratios need more tension to keep large text readable. */
|
|
352
|
+
--fluid-tension: calc(var(--physics-slope) * 0.3vw);
|
|
353
|
+
|
|
354
|
+
/* ===== 3. FLUID TYPOGRAPHY =====
|
|
355
|
+
Base size starts at 1rem and grows according to the Physics Slope.
|
|
356
|
+
*/
|
|
357
|
+
--base-size: var(--font-text-size, 1rem);
|
|
358
|
+
|
|
359
|
+
--font-size: clamp(
|
|
360
|
+
var(--base-size),
|
|
361
|
+
calc(var(--base-size) + var(--fluid-growth)),
|
|
362
|
+
calc(var(--base-size) * 1.5)
|
|
363
|
+
);
|
|
364
|
+
|
|
365
|
+
/* ===== 4. FLUID LINE HEIGHT =====
|
|
366
|
+
This is the "Next Level" logic.
|
|
367
|
+
Start with the Optical Ratio as the base breathing room (in ems).
|
|
368
|
+
As the screen (and font) grows, SUBTRACT the Tension Factor.
|
|
369
|
+
|
|
370
|
+
Why? Large text (Desktop) needs TIGHTER leading than small text (Mobile).
|
|
371
|
+
A steep ratio (Golden) creates huge text, so it applies MORE tension.
|
|
372
|
+
*/
|
|
373
|
+
--line-height: clamp(
|
|
374
|
+
1.15,
|
|
375
|
+
calc(var(--optical-ratio) - (var(--fluid-tension) / 1vw)),
|
|
376
|
+
1.65
|
|
377
|
+
);
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
@mixin grid-line-height($tightness: 1.1) {
|
|
383
|
+
/* The "Target" is simply the font-size * tightness */
|
|
384
|
+
--target-lh: calc(1em * #{$tightness});
|
|
385
|
+
|
|
386
|
+
/* The Snap: Force it to be a multiple of --baseline */
|
|
387
|
+
line-height: round(up, var(--target-lh), var(--baseline)) !important;
|
|
388
|
+
|
|
389
|
+
/* Why 'up'?
|
|
390
|
+
'nearest' might snap down and cause letters to clash.
|
|
391
|
+
'up' ensures we always have *at least* enough room. */
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
/* Usage in your Header sizes */
|
|
395
|
+
h1 {
|
|
396
|
+
/* Giant text needs very tight leading (1.05x), then snap up */
|
|
397
|
+
@include grid-line-height(1.05);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
h2,
|
|
401
|
+
h3 {
|
|
402
|
+
/* Medium headers breathe a bit more (1.15x), then snap up */
|
|
403
|
+
@include grid-line-height(1.15);
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
h4,
|
|
407
|
+
h5,
|
|
408
|
+
h6 {
|
|
409
|
+
/* Small headers need body-like leading (1.3x), then snap up */
|
|
410
|
+
@include grid-line-height(1.3);
|
|
411
|
+
}
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
@use "standard-00-variables" as *;
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @component Grid System
|
|
5
|
+
* @category Layout
|
|
6
|
+
* @description 12-column Swiss-style responsive grid with flexible gaps and alignment.
|
|
7
|
+
* Uses CSS Grid with logical properties for RTL support. Supports nested grids,
|
|
8
|
+
* asymmetric layouts, gap variants (compact/normal/wide), and responsive column changes.
|
|
9
|
+
* All gaps align to the vertical rhythm system.
|
|
10
|
+
*
|
|
11
|
+
* @prop {class} .grid 12-column grid container
|
|
12
|
+
* @prop {class} .grid-2 through .grid-12 Predefined grid layouts (2-12 columns)
|
|
13
|
+
* @prop {class} .col-1 through .col-12 Column span modifiers
|
|
14
|
+
* @prop {class} .col-sm-* Responsive columns at 768px+
|
|
15
|
+
* @prop {class} .col-lg-* Responsive columns at 1024px+
|
|
16
|
+
* @prop {class} .start-{n} Start column position (1-12)
|
|
17
|
+
* @prop {class} .gap-compact compact gap (1/4 space)
|
|
18
|
+
* @prop {class} .gap-wide Wide gap (1.5 space)
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* // Basic 12-column grid with equal width columns
|
|
22
|
+
* <div class="grid">
|
|
23
|
+
* <div class="col-3">Item 1</div>
|
|
24
|
+
* <div class="col-3">Item 2</div>
|
|
25
|
+
* <div class="col-3">Item 3</div>
|
|
26
|
+
* <div class="col-3">Item 4</div>
|
|
27
|
+
* </div>
|
|
28
|
+
*
|
|
29
|
+
* // Responsive grid layout
|
|
30
|
+
* <div class="grid">
|
|
31
|
+
* <div class="col-12 col-sm-6 col-lg-3">Card</div>
|
|
32
|
+
* <div class="col-12 col-sm-6 col-lg-3">Card</div>
|
|
33
|
+
* </div>
|
|
34
|
+
*
|
|
35
|
+
* // Main content + sidebar layout
|
|
36
|
+
* <div class="grid">
|
|
37
|
+
* <div class="col-8">Main content</div>
|
|
38
|
+
* <div class="col-4">Sidebar</div>
|
|
39
|
+
* </div>
|
|
40
|
+
*
|
|
41
|
+
* @since 0.1.0
|
|
42
|
+
* @see standard-04-rhythm.scss
|
|
43
|
+
*/
|
|
44
|
+
|
|
45
|
+
/* Harmony Grid (unified) — 12-col Swiss-style grid with rhythm-native gaps
|
|
46
|
+
Use this as your single grid across the site (replaces old .h-grid API).
|
|
47
|
+
Relies on logical properties and Harmony tokens: --base, calc(var(--space) / 4), --base-2, borders, etc.
|
|
48
|
+
*/
|
|
49
|
+
|
|
50
|
+
/* Grid container */
|
|
51
|
+
.grid,
|
|
52
|
+
[class^="grid-"],
|
|
53
|
+
.grid-row {
|
|
54
|
+
display: grid;
|
|
55
|
+
grid-auto-columns: 1fr;
|
|
56
|
+
grid-auto-flow: column;
|
|
57
|
+
column-gap: var(--gap);
|
|
58
|
+
row-gap: var(--gap);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.grid,
|
|
62
|
+
[class^="grid-"] {
|
|
63
|
+
> * {
|
|
64
|
+
margin: 0;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.grid-row {
|
|
69
|
+
grid-auto-flow: row;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* =========================== */
|
|
73
|
+
/* TYPOGRAPHIC NUANCES */
|
|
74
|
+
/* =========================== */
|
|
75
|
+
|
|
76
|
+
[class^="grid"] > * {
|
|
77
|
+
min-width: 0;
|
|
78
|
+
/* ← Force items to shrink below content size */
|
|
79
|
+
margin-block: 0;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
@media (max-width: #{$mobile}) {
|
|
83
|
+
[class^="grid"] > * {
|
|
84
|
+
min-width: 0;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
[class^="grid"] {
|
|
89
|
+
.card {
|
|
90
|
+
margin: 0;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/* Gap variants aligned to rhythm */
|
|
95
|
+
:is(.grid, [class^="grid-"]).compact {
|
|
96
|
+
--gap: var(--trim);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
:is(.grid, [class^="grid-"]).relaxed {
|
|
100
|
+
--gap: var(--space);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/* Spans 1..12 */
|
|
104
|
+
@for $i from 1 through 12 {
|
|
105
|
+
.grid-#{$i} {
|
|
106
|
+
display: grid;
|
|
107
|
+
grid-auto-columns: unset;
|
|
108
|
+
grid-auto-flow: unset;
|
|
109
|
+
grid-template-columns: repeat(#{$i}, minmax(0, 1fr));
|
|
110
|
+
column-gap: var(--gap);
|
|
111
|
+
row-gap: var(--gap);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/* Spans 1..12 */
|
|
116
|
+
@for $i from 1 through 12 {
|
|
117
|
+
.col-#{$i} {
|
|
118
|
+
grid-column: span #{$i};
|
|
119
|
+
margin-block-end: 0;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.start-#{$i} {
|
|
123
|
+
grid-column-start: #{$i};
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/* Responsive spans/starts: md ≥ #{$small}, lg ≥ #{$large} */
|
|
128
|
+
@media (max-width: #{$small}) {
|
|
129
|
+
@for $i from 1 through 12 {
|
|
130
|
+
/* Experimental.. default all grid to be 1 on mobile */
|
|
131
|
+
.grid-#{$i} {
|
|
132
|
+
grid-auto-columns: unset;
|
|
133
|
+
grid-auto-flow: unset;
|
|
134
|
+
grid-template-columns: repeat(1, 1fr) !important;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.sm\:grid-#{$i} {
|
|
138
|
+
grid-auto-columns: unset;
|
|
139
|
+
grid-auto-flow: unset;
|
|
140
|
+
grid-template-columns: repeat(#{$i}, 1fr) !important;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.sm\:col-#{$i} {
|
|
144
|
+
grid-column: span #{$i};
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.sm\:start-#{$i} {
|
|
148
|
+
grid-column-start: #{$i};
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.sm\:last {
|
|
153
|
+
order: 999;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.sm\:row {
|
|
157
|
+
grid-column: 1 / -1;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
@media (min-width: #{$large}) {
|
|
162
|
+
@for $i from 1 through 12 {
|
|
163
|
+
.lg\:grid-#{$i} {
|
|
164
|
+
display: grid;
|
|
165
|
+
grid-template-columns: repeat(#{$i}, 1fr);
|
|
166
|
+
column-gap: var(--gap);
|
|
167
|
+
row-gap: var(--gap);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.lg\:col-#{$i} {
|
|
171
|
+
grid-column: span #{$i};
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.lg\:start-#{$i} {
|
|
175
|
+
grid-column-start: #{$i};
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.lg\:row {
|
|
180
|
+
grid-column: 1 / -1;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/* Full-span helper (replaces old .h-col-full) */
|
|
185
|
+
.row,
|
|
186
|
+
.col-row,
|
|
187
|
+
.col-full {
|
|
188
|
+
grid-column: 1 / -1;
|
|
189
|
+
margin-block-end: 0;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
hr.col-row {
|
|
193
|
+
margin-block: var(--space);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/* Rhythm inside grid items: apply to a cell containing prose */
|
|
197
|
+
.grid .rhythm > * {
|
|
198
|
+
margin-block-end: var(--space);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/* Free columns: place anywhere with CSS vars or utility shorthands */
|
|
202
|
+
.free-col {
|
|
203
|
+
/* Defaults; authors override via CSS vars or utilities */
|
|
204
|
+
--start: auto;
|
|
205
|
+
/* 1..12 or auto */
|
|
206
|
+
--span: 3;
|
|
207
|
+
/* 1..12 */
|
|
208
|
+
|
|
209
|
+
grid-column: var(--start) / span var(--span);
|
|
210
|
+
|
|
211
|
+
/* If the free column contains prose, opt-in to rhythm */
|
|
212
|
+
&.rhythm > * {
|
|
213
|
+
margin-block-end: var(--space);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/* Utility-class interface to set the CSS vars (ergonomic authoring) */
|
|
218
|
+
@for $i from 1 through 12 {
|
|
219
|
+
.span-#{$i} {
|
|
220
|
+
--span: #{$i};
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.startv-#{$i} {
|
|
224
|
+
--start: #{$i};
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/* 'startv' to avoid clash with .start- utilities */
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/* Responsive overrides for the var-based API */
|
|
231
|
+
@media (max-width: #{$small}) {
|
|
232
|
+
@for $i from 1 through 12 {
|
|
233
|
+
.sm\:span-#{$i} {
|
|
234
|
+
--span: #{$i};
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.sm\:startv-#{$i} {
|
|
238
|
+
--start: #{$i};
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
@media (min-width: #{$large}) {
|
|
244
|
+
@for $i from 1 through 12 {
|
|
245
|
+
.lg\:span-#{$i} {
|
|
246
|
+
--span: #{$i};
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.lg\:startv-#{$i} {
|
|
250
|
+
--start: #{$i};
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/* Mobile fallback: stack free columns full-width */
|
|
256
|
+
@media (max-width: #{$small}) {
|
|
257
|
+
.free-col {
|
|
258
|
+
grid-column: 1 / -1;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/* Optional: sticky marginalia variant for editorial layouts */
|
|
263
|
+
.free-col.sticky {
|
|
264
|
+
position: sticky;
|
|
265
|
+
inset-block-start: var(--space);
|
|
266
|
+
align-self: start;
|
|
267
|
+
z-index: 1;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/* Row gap utilities for grid system */
|
|
271
|
+
.grid.no-gap {
|
|
272
|
+
row-gap: 0;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.grid.compact {
|
|
276
|
+
--grid-gap: var(--leading);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.grid.relaxed {
|
|
280
|
+
--grid-gap: var(--space-2);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/* Common layout containers inherit rhythm to cascade deeper */
|
|
284
|
+
.box,
|
|
285
|
+
.grid > .col-1,
|
|
286
|
+
.grid > .col-2,
|
|
287
|
+
.grid > .col-3,
|
|
288
|
+
.grid > .col-4,
|
|
289
|
+
.grid > .col-5,
|
|
290
|
+
.grid > .col-6,
|
|
291
|
+
.grid > .col-7,
|
|
292
|
+
.grid > .col-8,
|
|
293
|
+
.grid > .col-9,
|
|
294
|
+
.grid > .col-10,
|
|
295
|
+
.grid > .col-11,
|
|
296
|
+
.grid > .col-12,
|
|
297
|
+
.grid > .col-full {
|
|
298
|
+
> * {
|
|
299
|
+
margin-block: 0;
|
|
300
|
+
margin-block-end: var(--space);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
> :last-child {
|
|
304
|
+
margin-block-end: 0;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
> :first-child {
|
|
308
|
+
margin-block-start: 0;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
[class|="grid"] .container-hero {
|
|
313
|
+
margin-inline: 0;
|
|
314
|
+
}
|