@stnd/styles 0.10.2 → 0.10.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.
@@ -28,18 +28,19 @@
28
28
  "0": 0,
29
29
  "auto": auto,
30
30
 
31
- /* Industrial T-shirt Scale */ "3xs": var(--size-3xs),
32
- "2xs": var(--size-2xs),
33
- "xs": var(--size-xs),
34
- "sm": var(--size-sm),
35
- "base": var(--size-base),
36
- "lg": var(--size-lg),
37
- "xl": var(--size-xl),
38
- "2xl": var(--size-2xl),
39
- "3xl": var(--size-3xl),
40
- "4xl": var(--size-4xl),
41
- "5xl": var(--size-5xl),
42
- "6xl": var(--size-6xl),
31
+ /* Optical Scale */
32
+ "3xs": var(--scale-d5),
33
+ "2xs": var(--scale-d4),
34
+ "xs": var(--scale-d3),
35
+ "sm": var(--scale-d2),
36
+ "base": var(--scale),
37
+ "lg": var(--scale-2),
38
+ "xl": var(--scale-3),
39
+ "2xl": var(--scale-4),
40
+ "3xl": var(--scale-5),
41
+ "4xl": var(--scale-6),
42
+ "5xl": var(--scale-7),
43
+ "6xl": var(--scale-8),
43
44
  /* Mathematical Unit Scale (1-12) */ "": var(--space),
44
45
  "2": var(--space-2),
45
46
  "3": var(--space-3),
@@ -53,36 +54,35 @@
53
54
  "11": var(--space-11),
54
55
  "12": var(--space-12),
55
56
  "half": var(--space-d2),
56
- /* Naming collision worth knowing: this "trim"/"leading" scale keys
57
- (feeding .mt-trim, .p-leading, etc.) use --size-2xs/--size-xs (the
58
- type scale) — NOT the real --trim/--leading rhythm tokens
59
- (_standard-01-token.scss) that happen to share the same words.
60
- A class like .mt-trim does not use --trim. */
61
- "trim": var(--size-2xs),
62
- "leading": var(--size-xs),
57
+ /* Vertical Rhythm Tokens */
58
+ "trim": var(--trim),
59
+ "leading": var(--leading),
63
60
  );
64
61
 
65
62
  // Loop through and generate classes
66
63
  @each $suffix, $value in $scales {
67
- @if $suffix == "" {
68
- .#{$prefix} {
69
- #{$property}: $value !important;
70
- }
71
- } @else {
72
- .#{$prefix}-#{$suffix} {
73
- #{$property}: $value !important;
64
+ $invalid-auto: $value == auto and ($property == padding or $property == padding-top or $property == padding-bottom or $property == padding-left or $property == padding-right or $property == padding-inline or $property == padding-block or $property == gap or $property == column-gap or $property == row-gap);
65
+ $invalid-gap-full: $value == 100% and ($property == gap or $property == column-gap or $property == row-gap);
66
+
67
+ @if not $invalid-auto and not $invalid-gap-full {
68
+ @if $suffix == "" {
69
+ .#{$prefix} {
70
+ #{$property}: $value !important;
71
+ }
72
+ } @else {
73
+ .#{$prefix}-#{$suffix} {
74
+ #{$property}: $value !important;
75
+ }
74
76
  }
75
77
  }
76
78
  }
77
79
  }
78
80
 
79
- .w-auto {
80
- width: auto !important;
81
- }
81
+ /* ============================================================ */
82
+ /* WIDTH */
83
+ /* ============================================================ */
82
84
 
83
- .w-full {
84
- width: 100% !important;
85
- }
85
+ @include generate-scale(w, width);
86
86
 
87
87
  .w-screen {
88
88
  width: 100vw !important;
@@ -103,10 +103,6 @@
103
103
  /* Min-width */
104
104
  @include generate-scale(min-w, min-width);
105
105
 
106
- .min-w-full {
107
- min-width: 100% !important;
108
- }
109
-
110
106
  .min-w-screen {
111
107
  min-width: 100vw !important;
112
108
  }
@@ -118,10 +114,6 @@
118
114
  max-width: none !important;
119
115
  }
120
116
 
121
- .max-w-full {
122
- max-width: 100% !important;
123
- }
124
-
125
117
  .max-w-screen {
126
118
  max-width: 100vw !important;
127
119
  }
@@ -130,20 +122,21 @@
130
122
  max-width: var(--mobile) !important;
131
123
  }
132
124
 
133
- .max-w-small {
134
- max-width: var(--line-width-sm) !important;
125
+ .max-w-prose {
126
+ max-width: var(--prose-width) !important;
135
127
  }
136
128
 
137
- .max-w-large {
138
- max-width: var(--line-width-lg) !important;
129
+ .narrow {
130
+ margin-inline: var(--prose-inset) !important;
139
131
  }
140
132
 
141
- .max-w-medium {
142
- max-width: var(--line-width-md) !important;
133
+ .max-w-wide,
134
+ .wide:not(.prose *) {
135
+ max-width: calc(var(--prose-width) + (var(--space-4) * 2)) !important;
143
136
  }
144
137
 
145
- .max-w-line {
146
- max-width: var(--line-width) !important;
138
+ .max-w-page {
139
+ max-width: var(--page-max-width) !important;
147
140
  }
148
141
 
149
142
  /* ============================================================ */
@@ -152,14 +145,6 @@
152
145
 
153
146
  @include generate-scale(h, height);
154
147
 
155
- .h-auto {
156
- height: auto !important;
157
- }
158
-
159
- .h-full {
160
- height: 100% !important;
161
- }
162
-
163
148
  .h-screen {
164
149
  height: 100vh !important;
165
150
  }
@@ -179,10 +164,6 @@
179
164
  /* Min-height */
180
165
  @include generate-scale(min-h, min-height);
181
166
 
182
- .min-h-full {
183
- min-height: 100% !important;
184
- }
185
-
186
167
  .min-h-screen {
187
168
  min-height: 100vh !important;
188
169
  }
@@ -194,30 +175,10 @@
194
175
  max-height: none !important;
195
176
  }
196
177
 
197
- .max-h-full {
198
- max-height: 100% !important;
199
- }
200
-
201
178
  .max-h-screen {
202
179
  max-height: 100vh !important;
203
180
  }
204
181
 
205
- .m-gap-header {
206
- margin-top: var(--gap-header);
207
- }
208
-
209
- .p-gap-header {
210
- padding-top: var(--gap-header);
211
- }
212
-
213
- .m-gap-footer {
214
- margin-bottom: var(--gap-footer);
215
- }
216
-
217
- .p-gap-footer {
218
- padding-bottom: var(--gap-footer);
219
- }
220
-
221
182
  /* ============================================================ */
222
183
  /* DISPLAY */
223
184
  /* ============================================================ */
@@ -272,7 +233,7 @@
272
233
  display: flex !important;
273
234
  gap: var(--gap);
274
235
 
275
- & :not(.rhythm) * {
236
+ &:not(.rhythm) > * {
276
237
  margin-top: 0;
277
238
  }
278
239
  }
@@ -371,7 +332,7 @@
371
332
  }
372
333
 
373
334
  .no-body-margin {
374
- margin-inline: calc((var(--gap-body) * -1)) !important;
335
+ margin-inline: calc((var(--page-padding) * -1)) !important;
375
336
  }
376
337
 
377
338
  .full-bleed {
@@ -382,8 +343,8 @@
382
343
  }
383
344
 
384
345
  .breakout {
385
- width: min(100%, 72rem) !important;
386
- max-width: 72rem !important;
346
+ width: min(100%, var(--page-max-width)) !important;
347
+ max-width: var(--page-max-width) !important;
387
348
  margin-inline: auto !important;
388
349
  }
389
350
 
@@ -394,7 +355,7 @@
394
355
  margin-block: var(--gap-section, 6rem);
395
356
  margin-inline: auto;
396
357
  width: min(100%, 18rem);
397
- scroll-margin-top: calc(var(--gap-header, 3.5rem) + 1.5rem);
358
+ scroll-margin-top: var(--space-6);
398
359
 
399
360
  &.screen-full {
400
361
  width: 100%;
@@ -417,7 +378,7 @@
417
378
  .stnd-screen-section {
418
379
  width: 100%;
419
380
  margin-block: var(--gap-section, 4rem);
420
- scroll-margin-top: calc(var(--gap-header, 3.5rem) + 1.5rem);
381
+ scroll-margin-top: var(--space-6);
421
382
 
422
383
  &.screen-full {
423
384
  min-height: 85vh;
@@ -432,52 +393,64 @@
432
393
  /* TYPOGRAPHY — Size */
433
394
  /* ============================================================ */
434
395
 
435
- .text-3xs {
436
- font-size: var(--size-3xs) !important;
396
+ .text-3xs,
397
+ .text-scale-d5 {
398
+ font-size: var(--scale-d5) !important;
437
399
  }
438
400
 
439
- .text-2xs {
440
- font-size: var(--size-2xs) !important;
401
+ .text-2xs,
402
+ .text-scale-d4 {
403
+ font-size: var(--scale-d4) !important;
441
404
  }
442
405
 
443
- .text-xs {
444
- font-size: var(--size-xs) !important;
406
+ .text-xs,
407
+ .text-scale-d3 {
408
+ font-size: var(--scale-d3) !important;
445
409
  }
446
410
 
447
- .text-sm {
448
- font-size: var(--size-sm) !important;
411
+ .text-sm,
412
+ .text-scale-d2 {
413
+ font-size: var(--scale-d2) !important;
449
414
  }
450
415
 
451
- .text-base {
452
- font-size: var(--size-base) !important;
416
+ .text-base,
417
+ .text-scale {
418
+ font-size: var(--scale) !important;
453
419
  }
454
420
 
455
- .text-lg {
456
- font-size: var(--size-lg) !important;
421
+ .text-lg,
422
+ .text-scale-2 {
423
+ font-size: var(--scale-2) !important;
457
424
  }
458
425
 
459
- .text-xl {
460
- font-size: var(--size-xl) !important;
426
+ .text-xl,
427
+ .text-scale-3 {
428
+ font-size: var(--scale-3) !important;
461
429
  }
462
430
 
463
- .text-2xl {
464
- font-size: var(--size-2xl) !important;
431
+ .text-2xl,
432
+ .text-scale-4 {
433
+ font-size: var(--scale-4) !important;
465
434
  }
466
435
 
467
- .text-3xl {
468
- font-size: var(--size-3xl) !important;
436
+ .text-3xl,
437
+ .text-scale-5 {
438
+ font-size: var(--scale-5) !important;
469
439
  }
470
440
 
471
- .text-4xl {
472
- font-size: var(--size-4xl) !important;
441
+ .text-4xl,
442
+ .text-scale-6 {
443
+ font-size: var(--scale-6) !important;
473
444
  }
474
445
 
475
- .text-5xl {
476
- font-size: var(--size-5xl) !important;
446
+ .text-5xl,
447
+ .text-scale-7 {
448
+ font-size: var(--scale-7) !important;
477
449
  }
478
450
 
479
- .text-6xl {
480
- font-size: var(--size-6xl) !important;
451
+ .text-6xl,
452
+ .text-scale-8 {
453
+ font-size: var(--scale-8) !important;
481
454
  }
482
455
 
483
456
  /* ============================================================ */
@@ -571,7 +544,8 @@
571
544
  white-space: nowrap !important;
572
545
  }
573
546
 
574
- .no-trim {
547
+ .no-trim,
548
+ .trim-none {
575
549
  text-box-trim: none !important;
576
550
 
577
551
  * {
@@ -579,6 +553,14 @@
579
553
  }
580
554
  }
581
555
 
556
+ .trim-baseline {
557
+ text-box-edge: cap alphabetic !important;
558
+ }
559
+
560
+ .trim-cap {
561
+ text-box-edge: cap text !important;
562
+ }
563
+
582
564
  .ellipsis,
583
565
  .ellipsis li {
584
566
  overflow: hidden;
@@ -589,35 +571,6 @@
589
571
  text-box-edge: inherit;
590
572
  }
591
573
 
592
- /* ============================================================ */
593
- /* READING WIDTH (line-width constraints) */
594
- /* ============================================================ */
595
-
596
- .line-xs {
597
- max-width: var(--line-width-xs) !important;
598
- }
599
-
600
- /* Fixed 2026-07-14 — was --line-width-s/-l (undefined), corrected to the
601
- real --line-width-sm/-lg (all 3 occurrences). */
602
- .line-s {
603
- max-width: var(--line-width-sm) !important;
604
- }
605
-
606
- .line {
607
- max-width: var(--line-width) !important;
608
- }
609
-
610
- .line-l {
611
- max-width: var(--line-width-lg) !important;
612
- }
613
-
614
- .line-xl {
615
- max-width: var(--line-width-xl) !important;
616
- }
617
-
618
- .line-full {
619
- max-width: var(--line-width-full) !important;
620
- }
621
574
 
622
575
  /* ============================================================ */
623
576
  /* COLORS — Text (semantic) */
@@ -742,20 +695,28 @@
742
695
  background-color: var(--color-glass);
743
696
  }
744
697
 
745
- .bg-surface-lowest {
746
- background-color: var(--color-surface-lowest) !important;
698
+ .bg-surface-light-1 {
699
+ background-color: var(--color-surface-light-1) !important;
700
+ }
701
+
702
+ .bg-surface-light-2 {
703
+ background-color: var(--color-surface-light-2) !important;
747
704
  }
748
705
 
749
- .bg-surface-low {
750
- background-color: var(--color-surface-low) !important;
706
+ .bg-surface-light-3 {
707
+ background-color: var(--color-surface-light-3) !important;
751
708
  }
752
709
 
753
- .bg-surface-high {
754
- background-color: var(--color-surface-high) !important;
710
+ .bg-surface-dark-1 {
711
+ background-color: var(--color-surface-dark-1) !important;
755
712
  }
756
713
 
757
- .bg-surface-highest {
758
- background-color: var(--color-surface-highest) !important;
714
+ .bg-surface-dark-2 {
715
+ background-color: var(--color-surface-dark-2) !important;
716
+ }
717
+
718
+ .bg-surface-dark-3 {
719
+ background-color: var(--color-surface-dark-3) !important;
759
720
  }
760
721
 
761
722
  /* ============================================================ */
@@ -803,10 +764,6 @@
803
764
  .invert {
804
765
  color: var(--color-background);
805
766
  background: var(--color-foreground);
806
-
807
- * {
808
- color: var(--color-background) !important;
809
- }
810
767
  }
811
768
 
812
769
  @media (prefers-color-scheme: dark) {
@@ -897,7 +854,7 @@
897
854
  /* ============================================================ */
898
855
 
899
856
  .rounded-sm {
900
- border-radius: calc(var(--radius) / 2) !important;
857
+ border-radius: var(--radius-sm) !important;
901
858
  }
902
859
 
903
860
  .rounded {
@@ -968,7 +925,7 @@
968
925
 
969
926
  .columns-auto {
970
927
  columns: auto;
971
- column-width: var(--line-width-sm);
928
+ column-width: calc(var(--prose-width) / 2);
972
929
  column-gap: var(--space);
973
930
  }
974
931
 
@@ -1085,11 +1042,10 @@
1085
1042
  @include generate-scale(gap-x, column-gap);
1086
1043
  @include generate-scale(gap-y, row-gap);
1087
1044
 
1088
- /* ============================================================ */
1089
- /* WIDTH */
1090
- /* ============================================================ */
1045
+ .gap-compact {
1046
+ gap: var(--gap-compact) !important;
1047
+ }
1091
1048
 
1092
- @include generate-scale(w, width);
1093
1049
 
1094
1050
  /* ============================================================ */
1095
1051
  /* RESPONSIVE BREAKPOINTS */
@@ -114,7 +114,7 @@ html.stnd-debug .rhythm > * + *::after {
114
114
  outline: 1px dashed color-mix(in srgb, var(--color-cyan) 25%, transparent);
115
115
 
116
116
  font-family: var(--font-monospace);
117
- font-size: var(--size-sm);
117
+ font-size: var(--scale-d2);
118
118
  z-index: 1; // Push it behind the content
119
119
  pointer-events: none; // So it doesn't interfere with interactions
120
120
  }
@@ -190,7 +190,7 @@ html.stnd-debug .rhythm > * + *::after {
190
190
  color: var(--color-cyan);
191
191
  opacity: var(--debug-opacity);
192
192
  font-family: var(--font-monospace);
193
- font-size: var(--size-sm);
193
+ font-size: var(--scale-d2);
194
194
  }
195
195
  .stnd-debug {
196
196
  h1::before {
@@ -318,7 +318,7 @@ html.stnd-debug .rhythm > * + *::after {
318
318
  position: absolute !important;
319
319
  inset: 0;
320
320
  color: var(--debug-color);
321
- font-size: var(--size-xs);
321
+ font-size: var(--scale-d3);
322
322
  font-family: var(--font-monospace);
323
323
  display: grid;
324
324
  grid-template-columns: repeat(var(--grid-cols), 1fr);
@@ -421,7 +421,7 @@ html.stnd-debug .rhythm > * + *::after {
421
421
  top: calc(var(--space) * -1);
422
422
  left: var(--space);
423
423
  color: var(--debug-color);
424
- font-size: var(--size-xs);
424
+ font-size: var(--scale-d3);
425
425
  font-family: var(--font-monospace);
426
426
  pointer-events: none;
427
427
  opacity: var(--debug-opacity);
@@ -440,7 +440,7 @@ html.stnd-debug .rhythm > * + *::after {
440
440
  left: var(--space);
441
441
  color: var(--debug-color);
442
442
  opacity: var(--debug-opacity);
443
- font-size: var(--size-xs);
443
+ font-size: var(--scale-d3);
444
444
  font-family: var(--font-monospace);
445
445
  padding: var(--space) var(--space);
446
446
  border-radius: var(--radius);
package/app.scss CHANGED
@@ -33,9 +33,6 @@
33
33
  (Gap formulas are duplicated rather than var(--gap)-referenced —
34
34
  referencing the token they feed would create a custom-property cycle.) */
35
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
36
 
40
37
  /* Tighter modular scale than the silver default — in an app, headings
41
38
  are labels and section chrome, not display type. */
@@ -54,8 +51,7 @@
54
51
  The framework derives --radius from --leading, a TYPOGRAPHIC rhythm
55
52
  value (~2.6px at 13px / 1.2), not a chrome corner. --corner is the
56
53
  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.
54
+ --radius-sm is set explicitly for chrome controls.
59
55
  --radius-lg has no framework equivalent; declared here so it is real. */
60
56
  --corner: 6px; /* feeds --radius */
61
57
  --radius-sm: 4px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stnd/styles",
3
- "version": "0.10.2",
3
+ "version": "0.10.4",
4
4
  "type": "module",
5
5
  "author": "Francis Fontaine",
6
6
  "license": "MIT",