@stackoverflow/stacks 0.75.0 → 1.0.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.
Files changed (89) hide show
  1. package/dist/controllers/index.d.ts +7 -0
  2. package/dist/controllers/s-expandable-control.d.ts +17 -0
  3. package/dist/controllers/s-modal.d.ts +97 -0
  4. package/dist/controllers/s-navigation-tablist.d.ts +36 -0
  5. package/dist/controllers/s-popover.d.ts +155 -0
  6. package/dist/controllers/s-table.d.ts +8 -0
  7. package/dist/controllers/s-tooltip.d.ts +82 -0
  8. package/dist/controllers/s-uploader.d.ts +48 -0
  9. package/dist/css/stacks.css +4379 -2660
  10. package/dist/css/stacks.min.css +1 -1
  11. package/dist/index.d.ts +3 -0
  12. package/dist/js/stacks.js +6026 -5403
  13. package/dist/js/stacks.min.js +1 -1
  14. package/dist/stacks.d.ts +21 -0
  15. package/lib/css/atomic/{_stacks-borders.less → borders.less} +30 -30
  16. package/lib/css/atomic/{_stacks-colors.less → colors.less} +0 -0
  17. package/lib/css/atomic/{_stacks-flex.less → flex.less} +14 -13
  18. package/lib/css/atomic/{_stacks-grid.less → grid.less} +12 -11
  19. package/lib/css/atomic/{_stacks-misc.less → misc.less} +22 -22
  20. package/lib/css/atomic/spacing.less +314 -0
  21. package/lib/css/atomic/{_stacks-typography.less → typography.less} +29 -29
  22. package/lib/css/atomic/width-height.less +194 -0
  23. package/lib/css/base/{_stacks-body.less → body.less} +3 -5
  24. package/lib/css/base/{_stacks-configuration-static.less → configuration-static.less} +3 -1
  25. package/lib/css/base/{_stacks-icons.less → icons.less} +0 -0
  26. package/lib/css/base/{_stacks-internals.less → internals.less} +0 -10
  27. package/lib/css/base/{_stacks-reset-meyer.less → reset-meyer.less} +0 -0
  28. package/lib/css/base/{_stacks-reset-normalize.less → reset-normalize.less} +0 -0
  29. package/lib/css/base/{_stacks-reset.less → reset.less} +2 -2
  30. package/lib/css/components/{_stacks-activity-indicator.less → activity-indicator.less} +9 -9
  31. package/lib/css/components/{_stacks-avatars.less → avatars.less} +40 -40
  32. package/lib/css/components/{_stacks-badges.less → badges.less} +11 -11
  33. package/lib/css/components/{_stacks-banners.less → banners.less} +5 -6
  34. package/lib/css/components/{_stacks-blank-states.less → blank-states.less} +2 -2
  35. package/lib/css/components/{_stacks-breadcrumbs.less → breadcrumbs.less} +7 -7
  36. package/lib/css/components/{_stacks-button-groups.less → button-groups.less} +2 -2
  37. package/lib/css/components/{_stacks-buttons.less → buttons.less} +77 -72
  38. package/lib/css/components/{_stacks-cards.less → cards.less} +2 -2
  39. package/lib/css/components/{_stacks-code-blocks.less → code-blocks.less} +8 -8
  40. package/lib/css/components/{_stacks-collapsible.less → collapsible.less} +0 -0
  41. package/lib/css/components/{_stacks-inputs.less → inputs.less} +41 -41
  42. package/lib/css/components/{_stacks-link-previews.less → link-previews.less} +17 -17
  43. package/lib/css/components/{_stacks-links.less → links.less} +4 -4
  44. package/lib/css/components/{_stacks-menu.less → menu.less} +5 -5
  45. package/lib/css/components/{_stacks-modals.less → modals.less} +20 -20
  46. package/lib/css/components/{_stacks-navigation.less → navigation.less} +12 -12
  47. package/lib/css/components/{_stacks-notices.less → notices.less} +12 -12
  48. package/lib/css/components/{_stacks-page-titles.less → page-titles.less} +9 -9
  49. package/lib/css/components/{_stacks-pagination.less → pagination.less} +8 -8
  50. package/lib/css/components/{_stacks-popovers.less → popovers.less} +17 -17
  51. package/lib/css/components/{_stacks-post-summary.less → post-summary.less} +35 -35
  52. package/lib/css/components/{_stacks-progress-bars.less → progress-bars.less} +29 -30
  53. package/lib/css/components/{_stacks-prose.less → prose.less} +31 -31
  54. package/lib/css/components/{_stacks-spinner.less → spinner.less} +14 -14
  55. package/lib/css/components/{_stacks-tables.less → tables.less} +10 -10
  56. package/lib/css/components/{_stacks-tags.less → tags.less} +33 -41
  57. package/lib/css/components/{_stacks-toggle-switches.less → toggle-switches.less} +5 -5
  58. package/lib/css/components/{_stacks-topbar.less → topbar.less} +27 -40
  59. package/lib/css/components/{_stacks-uploader.less → uploader.less} +18 -18
  60. package/lib/css/components/{_stacks-user-cards.less → user-cards.less} +14 -14
  61. package/lib/css/components/{_stacks-widget-dynamic.less → widget-dynamic.less} +1 -1
  62. package/lib/css/components/{_stacks-widget-static.less → widget-static.less} +39 -38
  63. package/lib/css/exports/{_stacks-constants-colors.less → constants-colors.less} +10 -30
  64. package/lib/css/exports/constants-helpers.less +108 -0
  65. package/lib/css/exports/constants-type.less +153 -0
  66. package/lib/css/exports/{_stacks-exports.less → exports.less} +4 -4
  67. package/lib/css/exports/{_stacks-mixins.less → mixins.less} +18 -1
  68. package/lib/css/stacks-dynamic.less +12 -13
  69. package/lib/css/stacks-static.less +38 -38
  70. package/lib/ts/controllers/index.ts +8 -0
  71. package/lib/ts/controllers/s-expandable-control.ts +163 -164
  72. package/lib/ts/controllers/s-modal.ts +259 -261
  73. package/lib/ts/controllers/s-navigation-tablist.ts +96 -97
  74. package/lib/ts/controllers/s-popover.ts +438 -440
  75. package/lib/ts/controllers/s-table.ts +203 -203
  76. package/lib/ts/controllers/s-tooltip.ts +195 -196
  77. package/lib/ts/controllers/s-uploader.ts +162 -164
  78. package/lib/ts/index.ts +20 -0
  79. package/lib/ts/stacks.ts +73 -68
  80. package/lib/tsconfig.json +8 -6
  81. package/package.json +40 -24
  82. package/dist/css/stacks-flexgrid-shim.min.css +0 -1
  83. package/lib/css/atomic/_stacks-spacing.less +0 -168
  84. package/lib/css/atomic/_stacks-width-height.less +0 -195
  85. package/lib/css/base/_stacks-configuration-dynamic.less +0 -106
  86. package/lib/css/exports/_stacks-constants-helpers.less +0 -139
  87. package/lib/css/exports/_stacks-constants-type.less +0 -91
  88. package/lib/ts/finalize.ts +0 -1
  89. package/lib/ts/stimulus.d.ts +0 -4
@@ -46,34 +46,34 @@
46
46
  // ----------------------------------------------------------------------------
47
47
  // $$ All Sides
48
48
  #stacks-internals #responsify('.baw0', { border-width: 0 !important; });
49
- .baw1 { border-width: (@su2 / 2) !important; }
50
- .baw2 { border-width: @su2 !important; }
51
- .baw3 { border-width: @su4 !important; }
49
+ .baw1 { border-width: var(--su-static1) !important; }
50
+ .baw2 { border-width: var(--su-static2) !important; }
51
+ .baw3 { border-width: var(--su-static4) !important; }
52
52
 
53
53
  // $$ Top Border
54
54
  #stacks-internals #responsify('.btw0', { border-top-width: 0 !important; });
55
- .btw1 { border-top-width: (@su2 / 2) !important; }
56
- .btw2 { border-top-width: @su2 !important; }
57
- .btw3 { border-top-width: @su4 !important; }
55
+ .btw1 { border-top-width: var(--su-static1) !important; }
56
+ .btw2 { border-top-width: var(--su-static2) !important; }
57
+ .btw3 { border-top-width: var(--su-static4) !important; }
58
58
 
59
59
  // $$ Right Border
60
60
  #stacks-internals #responsify('.brw0', { border-right-width: 0 !important; });
61
- .brw1 { border-right-width: (@su2 / 2) !important; }
62
- .brw2 { border-right-width: @su2 !important; }
63
- .brw3 { border-right-width: @su4 !important; }
61
+ .brw1 { border-right-width: var(--su-static1) !important; }
62
+ .brw2 { border-right-width: var(--su-static2) !important; }
63
+ .brw3 { border-right-width: var(--su-static4) !important; }
64
64
 
65
65
  // $$ Bottom Border
66
66
  #stacks-internals #responsify('.bbw0', { border-bottom-width: 0 !important; });
67
- .bbw1 { border-bottom-width: (@su2 / 2) !important; }
68
- .bbw2 { border-bottom-width: @su2 !important; }
69
- .bbw3 { border-bottom-width: @su4 !important; }
67
+ .bbw1 { border-bottom-width: var(--su-static1) !important; }
68
+ .bbw2 { border-bottom-width: var(--su-static2) !important; }
69
+ .bbw3 { border-bottom-width: var(--su-static4) !important; }
70
70
 
71
71
  // $$ Left Border
72
72
  #stacks-internals #responsify('.blw0', { border-left-width: 0 !important; });
73
73
  .blw0 { border-left-width: 0 !important; }
74
- .blw1 { border-left-width: (@su2 / 2) !important; }
75
- .blw2 { border-left-width: @su2 !important; }
76
- .blw3 { border-left-width: @su4 !important; }
74
+ .blw1 { border-left-width: var(--su-static1) !important; }
75
+ .blw2 { border-left-width: var(--su-static2) !important; }
76
+ .blw3 { border-left-width: var(--su-static4) !important; }
77
77
 
78
78
  // $$ Y-Axis Border
79
79
  .byw0 { .btw0; .bbw0; }
@@ -121,35 +121,35 @@
121
121
  // br-lg: Large step: 7px border radius
122
122
  // ----------------------------------------------------------------------------
123
123
  // $$ All Sides
124
- .bar-sm { border-radius: @br-sm !important; }
125
- .bar-md { border-radius: @br-md !important; }
126
- .bar-lg { border-radius: @br-lg !important; }
124
+ .bar-sm { border-radius: var(--br-sm) !important; }
125
+ .bar-md { border-radius: var(--br-md) !important; }
126
+ .bar-lg { border-radius: var(--br-lg) !important; }
127
127
  .bar-circle { border-radius: 100% !important; }
128
128
  .bar-pill { border-radius: 1000px !important; }
129
129
 
130
130
  // $$ Top Left Corner
131
131
  .btlr0 { border-top-left-radius: 0 !important; }
132
- .btlr-sm { border-top-left-radius: @br-sm !important; }
133
- .btlr-md { border-top-left-radius: @br-md !important; }
134
- .btlr-lg { border-top-left-radius: @br-lg !important; }
132
+ .btlr-sm { border-top-left-radius: var(--br-sm) !important; }
133
+ .btlr-md { border-top-left-radius: var(--br-md) !important; }
134
+ .btlr-lg { border-top-left-radius: var(--br-lg) !important; }
135
135
 
136
136
  // $$ Top Right Corner
137
137
  .btrr0 { border-top-right-radius: 0 !important; }
138
- .btrr-sm { border-top-right-radius: @br-sm !important; }
139
- .btrr-md { border-top-right-radius: @br-md !important; }
140
- .btrr-lg { border-top-right-radius: @br-lg !important; }
138
+ .btrr-sm { border-top-right-radius: var(--br-sm) !important; }
139
+ .btrr-md { border-top-right-radius: var(--br-md) !important; }
140
+ .btrr-lg { border-top-right-radius: var(--br-lg) !important; }
141
141
 
142
142
  // $$ Bottom Left Corner
143
143
  .bblr0 { border-bottom-left-radius: 0 !important; }
144
- .bblr-sm { border-bottom-left-radius: @br-sm !important; }
145
- .bblr-md { border-bottom-left-radius: @br-md !important; }
146
- .bblr-lg { border-bottom-left-radius: @br-lg !important; }
144
+ .bblr-sm { border-bottom-left-radius: var(--br-sm) !important; }
145
+ .bblr-md { border-bottom-left-radius: var(--br-md) !important; }
146
+ .bblr-lg { border-bottom-left-radius: var(--br-lg) !important; }
147
147
 
148
148
  // $$ Bottom Right Corner
149
149
  .bbrr0 { border-bottom-right-radius: 0 !important; }
150
- .bbrr-sm { border-bottom-right-radius: @br-sm !important; }
151
- .bbrr-md { border-bottom-right-radius: @br-md !important; }
152
- .bbrr-lg { border-bottom-right-radius: @br-lg !important; }
150
+ .bbrr-sm { border-bottom-right-radius: var(--br-sm) !important; }
151
+ .bbrr-md { border-bottom-right-radius: var(--br-md) !important; }
152
+ .bbrr-lg { border-bottom-right-radius: var(--br-lg) !important; }
153
153
 
154
154
  // $$ Top Corners
155
155
  .btr0 { .btlr0; .btrr0; }
@@ -103,7 +103,7 @@
103
103
  @itemWidth: (@count * 100% / @num);
104
104
 
105
105
  > .flex--item@{count} {
106
- margin: (@spacing / 2);
106
+ margin: calc(~"@{spacing}" / 2);
107
107
  }
108
108
 
109
109
  // ------------------------------------------------------------------------
@@ -138,12 +138,12 @@
138
138
  .gutter-spacing(@spacing) {
139
139
  #stacks-internals #flex-builder-settings();
140
140
 
141
- margin: -(@spacing / 2);
141
+ margin: calc(~"@{spacing}" / 2 * -1);
142
142
 
143
143
  // -- FLUID ITEMS
144
144
  > .d-flex,
145
145
  > .flex--item {
146
- margin: (@spacing / 2);
146
+ margin: calc(~"@{spacing}" / 2);
147
147
  }
148
148
 
149
149
  // -- FIXED WIDTH ITEMS
@@ -196,16 +196,17 @@
196
196
  // $ FLEX SPACING
197
197
  // Insert spaces or gutters in between flex items
198
198
  // ----------------------------------------------------------------------------
199
- .gs2 { #stacks-internals #flex-builder-helpers .gutter-spacing(@su2); }
200
- .gs4 { #stacks-internals #flex-builder-helpers .gutter-spacing(@su4); }
201
- .gs6 { #stacks-internals #flex-builder-helpers .gutter-spacing(@su6); }
202
- .gs8 { #stacks-internals #flex-builder-helpers .gutter-spacing(@su8); }
203
- .gs12 { #stacks-internals #flex-builder-helpers .gutter-spacing(@su12); }
204
- .gs16 { #stacks-internals #flex-builder-helpers .gutter-spacing(@su16); }
205
- .gs24 { #stacks-internals #flex-builder-helpers .gutter-spacing(@su24); }
206
- .gs32 { #stacks-internals #flex-builder-helpers .gutter-spacing(@su32); }
207
- .gs48 { #stacks-internals #flex-builder-helpers .gutter-spacing(@su48); }
208
- .gs64 { #stacks-internals #flex-builder-helpers .gutter-spacing(@su64); }
199
+ // TODO: Make this play nice with spacing units… or yeet this in the age of gap
200
+ .gs2 { #stacks-internals #flex-builder-helpers .gutter-spacing(var(--su2)); }
201
+ .gs4 { #stacks-internals #flex-builder-helpers .gutter-spacing(var(--su4)); }
202
+ .gs6 { #stacks-internals #flex-builder-helpers .gutter-spacing(var(--su6)); }
203
+ .gs8 { #stacks-internals #flex-builder-helpers .gutter-spacing(var(--su8)); }
204
+ .gs12 { #stacks-internals #flex-builder-helpers .gutter-spacing(var(--su12)); }
205
+ .gs16 { #stacks-internals #flex-builder-helpers .gutter-spacing(var(--su16)); }
206
+ .gs24 { #stacks-internals #flex-builder-helpers .gutter-spacing(var(--su24)); }
207
+ .gs32 { #stacks-internals #flex-builder-helpers .gutter-spacing(var(--su32)); }
208
+ .gs48 { #stacks-internals #flex-builder-helpers .gutter-spacing(var(--su48)); }
209
+ .gs64 { #stacks-internals #flex-builder-helpers .gutter-spacing(var(--su64)); }
209
210
 
210
211
  // On rows, remove top and bottom margins
211
212
  .gsx {
@@ -21,17 +21,17 @@
21
21
  // into its own section and documentation
22
22
  // ----------------------------------------------------------------------------
23
23
  #stacks-internals #responsify('.g0', { gap: 0 });
24
- #stacks-internals #responsify('.g1', { gap: @su1 });
25
- #stacks-internals #responsify('.g2', { gap: @su2 });
26
- #stacks-internals #responsify('.g4', { gap: @su4; });
27
- #stacks-internals #responsify('.g6', { gap: @su6; });
28
- #stacks-internals #responsify('.g8', { gap: @su8; });
29
- #stacks-internals #responsify('.g12', { gap: @su12; });
30
- #stacks-internals #responsify('.g16', { gap: @su16; });
31
- #stacks-internals #responsify('.g24', { gap: @su24; });
32
- #stacks-internals #responsify('.g32', { gap: @su32; });
33
- #stacks-internals #responsify('.g48', { gap: @su48; });
34
- #stacks-internals #responsify('.g64', { gap: @su64; });
24
+ #stacks-internals #responsify('.g1', { gap: var(--su1) });
25
+ #stacks-internals #responsify('.g2', { gap: var(--su2) });
26
+ #stacks-internals #responsify('.g4', { gap: var(--su4); });
27
+ #stacks-internals #responsify('.g6', { gap: var(--su6); });
28
+ #stacks-internals #responsify('.g8', { gap: var(--su8); });
29
+ #stacks-internals #responsify('.g12', { gap: var(--su12); });
30
+ #stacks-internals #responsify('.g16', { gap: var(--su16); });
31
+ #stacks-internals #responsify('.g24', { gap: var(--su24); });
32
+ #stacks-internals #responsify('.g32', { gap: var(--su32); });
33
+ #stacks-internals #responsify('.g48', { gap: var(--su48); });
34
+ #stacks-internals #responsify('.g64', { gap: var(--su64); });
35
35
 
36
36
  // ============================================================================
37
37
  // $ GRID FLOW
@@ -55,6 +55,7 @@
55
55
  #stacks-internals #responsify('.grid__10', { grid-template-columns: repeat(10, minmax(0, 1fr)); });
56
56
  #stacks-internals #responsify('.grid__11', { grid-template-columns: repeat(11, minmax(0, 1fr)); });
57
57
  #stacks-internals #responsify('.grid__12', { grid-template-columns: repeat(12, minmax(0, 1fr)); });
58
+ #stacks-internals #responsify('.grid__auto', { grid-template-columns: auto 1fr; });
58
59
 
59
60
  // ============================================================================
60
61
  // $ COLUMN SPANS
@@ -250,24 +250,24 @@
250
250
  // ============================================================================
251
251
  // $ Z-INDEX
252
252
  // ----------------------------------------------------------------------------
253
- .z-hide { z-index: @zi-hide !important; }
254
- .z-base { z-index: @zi-base !important; }
255
- .z-active { z-index: @zi-active !important; }
256
- .z-selected { z-index: @zi-selected !important; }
257
- .z-dropdown { z-index: @zi-dropdown !important; }
258
- .z-popover { z-index: @zi-popovers !important; }
259
- .z-tooltip { z-index: @zi-tooltips !important; }
260
- .z-banner { z-index: @zi-banners !important; }
261
- .z-nav { z-index: @zi-navigation !important; }
262
- .z-nav-fixed { z-index: @zi-navigation-fixed !important; }
263
- .z-modal { z-index: @zi-modals !important; }
264
- .z-modal-bg { z-index: @zi-modals-background !important; }
253
+ .z-hide { z-index: var(--zi-hide) !important; }
254
+ .z-base { z-index: var(--zi-base) !important; }
255
+ .z-active { z-index: var(--zi-active) !important; }
256
+ .z-selected { z-index: var(--zi-selected) !important; }
257
+ .z-dropdown { z-index: var(--zi-dropdown) !important; }
258
+ .z-popover { z-index: var(--zi-popovers) !important; }
259
+ .z-tooltip { z-index: var(--zi-tooltips) !important; }
260
+ .z-banner { z-index: var(--zi-banners) !important; }
261
+ .z-nav { z-index: var(--zi-navigation) !important; }
262
+ .z-nav-fixed { z-index: var(--zi-navigation-fixed) !important; }
263
+ .z-modal { z-index: var(--zi-modals) !important; }
264
+ .z-modal-bg { z-index: var(--zi-modals-background) !important; }
265
265
 
266
266
  // ============================================================================
267
267
  // $ OUTLINE
268
268
  // ----------------------------------------------------------------------------
269
269
  .outline-none { outline: 0 !important; }
270
- .outline-ring { outline: solid @su4 var(--focus-ring); }
270
+ .outline-ring { outline: solid var(--su-static4) var(--focus-ring); }
271
271
 
272
272
  .f\:outline-ring {
273
273
  &:focus,
@@ -293,7 +293,7 @@
293
293
  .bs-lg { box-shadow: var(--bs-lg) !important; }
294
294
  .h\:bs-lg:hover { .bs-lg; }
295
295
  .bs-xl { box-shadow: var(--bs-xl) !important; }
296
- .bs-ring { box-shadow: 0 0 0 @su4 var(--focus-ring); }
296
+ .bs-ring { box-shadow: 0 0 0 var(--su-static4) var(--focus-ring); }
297
297
  .h\:bs-ring:hover { .bs-ring; }
298
298
  .f\:bs-ring {
299
299
  &:focus,
@@ -303,12 +303,12 @@
303
303
  }
304
304
 
305
305
  // -- Added hover styles for box-shadow
306
- .bs-sm.bs-hover:hover { box-shadow: 0 @su2 @su8 @black-050 !important; }
307
- .bs-md.bs-hover:hover { box-shadow: 0 @su4 @su8 @black-100 !important; }
308
- .bs-lg.bs-hover:hover { box-shadow: 0 @su4 @su12 fade(@black-300, 70%) !important; }
309
- .bs-i-sm.bs-hover:hover { box-shadow: inset 0 (@su2/2) @su8 0 fade(@black-200, 75%) !important; }
310
- .bs-i-md.bs-hover:hover { box-shadow: inset 0 (@su2/2) @su8 0 fade(@black-350, 80%) !important; }
311
- .bs-i-lg.bs-hover:hover { box-shadow: inset 0 (@su2/2) @su12 0 @black-350 !important; }
306
+ .bs-sm.bs-hover:hover { box-shadow: 0 var(--su-static2) var(--su-static8) @black-050 !important; }
307
+ .bs-md.bs-hover:hover { box-shadow: 0 var(--su-static4) var(--su-static8) @black-100 !important; }
308
+ .bs-lg.bs-hover:hover { box-shadow: 0 var(--su-static4) var(--su-static12) fade(@black-300, 70%) !important; }
309
+ .bs-i-sm.bs-hover:hover { box-shadow: inset 0 var(--su-static1) var(--su-static8) 0 fade(@black-200, 75%) !important; }
310
+ .bs-i-md.bs-hover:hover { box-shadow: inset 0 var(--su-static1) var(--su-static8) 0 fade(@black-350, 80%) !important; }
311
+ .bs-i-lg.bs-hover:hover { box-shadow: inset 0 var(--su-static1) var(--su-static12) 0 @black-350 !important; }
312
312
 
313
313
  // ============================================================================
314
314
  // $ TRANSITIONS
@@ -316,9 +316,9 @@
316
316
 
317
317
  // -- Provide a sensible default
318
318
  .t {
319
- transition-duration: @transition-time;
319
+ transition-duration: var(--transition-time);
320
320
  transition-property: all;
321
- transition-timing-function: @te-ease-in;
321
+ transition-timing-function: var(--te-ease-in);
322
322
  transition-delay: 0s;
323
323
  }
324
324
 
@@ -0,0 +1,314 @@
1
+ //
2
+ // STACK OVERFLOW
3
+ // SPACING
4
+ //
5
+ // This CSS comes from Stacks, our CSS & Pattern library for rapidly building
6
+ // Stack Overflow. For documentation of all these classes and how to contribute,
7
+ // visit https://stackoverflow.design/
8
+ //
9
+ // • SPACING UNIT CSS VARIABLES
10
+ // • MARGIN
11
+ // • PADDING
12
+ // • POSITIONING
13
+ //
14
+ // ============================================================================
15
+ // $ SPACING UNITS CSS VARIABLES
16
+ // ----------------------------------------------------------------------------
17
+ body {
18
+ --su-base: 1;
19
+ --su-static1: 1px;
20
+ --su-static2: 2px;
21
+ --su-static4: 4px;
22
+ --su-static6: 6px;
23
+ --su-static8: 8px;
24
+ --su-static12: 12px;
25
+ --su-static16: 16px;
26
+ --su-static24: 24px;
27
+ --su-static32: 32px;
28
+ --su-static48: 48px;
29
+ --su-static64: 64px;
30
+ --su-static96: 96px;
31
+ --su-static128: 128px;
32
+
33
+ // This ensures `--su1` never drops below 1px by setting the clamp MIN value to `--su-static1` (1px).
34
+ --su1: clamp(var(--su-static1), calc(var(--su-static1) * var(--su-base)), calc(var(--su-static1) * var(--su-base)));
35
+ --su2: calc(var(--su-static2) * var(--su-base));
36
+ --su4: calc(var(--su-static4) * var(--su-base));
37
+ --su6: calc(var(--su-static6) * var(--su-base));
38
+ --su8: calc(var(--su-static8) * var(--su-base));
39
+ --su12: calc(var(--su-static12) * var(--su-base));
40
+ --su16: calc(var(--su-static16) * var(--su-base));
41
+ --su24: calc(var(--su-static24) * var(--su-base));
42
+ --su32: calc(var(--su-static32) * var(--su-base));
43
+ --su48: calc(var(--su-static48) * var(--su-base));
44
+ --su64: calc(var(--su-static64) * var(--su-base));
45
+ --su96: calc(var(--su-static96) * var(--su-base));
46
+ --su128: calc(var(--su-static128) * var(--su-base));
47
+ }
48
+
49
+ // ============================================================================
50
+ // $ MARGIN
51
+ // ----------------------------------------------------------------------------
52
+ // $$ 0 margin
53
+ .m0 { margin: 0 !important; }
54
+ .mt0 { margin-top: 0 !important; }
55
+ .mr0 { margin-right: 0 !important; }
56
+ .mb0 { margin-bottom: 0 !important; }
57
+ .ml0 { margin-left: 0 !important; }
58
+ .mx0 { margin-left: 0 !important; margin-right: 0 !important; }
59
+ .my0 { margin-top: 0 !important; margin-bottom: 0 !important; }
60
+
61
+ // $$ auto margin
62
+ .m-auto { margin: auto !important; }
63
+ .mt-auto { margin-top: auto !important; }
64
+ .mr-auto { margin-right: auto !important; }
65
+ .mb-auto { margin-bottom: auto !important; }
66
+ .ml-auto { margin-left: auto !important; }
67
+ .mx-auto { margin-left: auto !important; margin-right: auto !important; }
68
+ .my-auto { margin-top: auto !important; margin-bottom: auto !important; }
69
+
70
+ // $$ Margin
71
+ #stacks-internals #build-classes(
72
+ responsive,
73
+ '.m',
74
+ { .template(@value) { margin: var(~"--su@{value}") !important; } },
75
+ 1 2 4 6 8 12 16 24 32 48 64 96 128
76
+ );
77
+
78
+ // $$ Margin negative
79
+ #stacks-internals #build-classes(
80
+ responsive,
81
+ '.mn',
82
+ { .template(@value) { margin: calc(var(~"--su@{value}") * -1) !important; } },
83
+ 1 2 4 6 8 12 16 24 32 48 64 96 128
84
+ );
85
+
86
+ // $$ Top margin
87
+ #stacks-internals #build-classes(
88
+ responsive,
89
+ '.mt',
90
+ { .template(@value) { margin-top: var(~"--su@{value}") !important; } },
91
+ 1 2 4 6 8 12 16 24 32 48 64 96 128
92
+ );
93
+
94
+ // $$ Top margin negative
95
+ #stacks-internals #build-classes(
96
+ responsive,
97
+ '.mtn',
98
+ { .template(@value) { margin-top: calc(var(~"--su@{value}") * -1) !important; } },
99
+ 1 2 4 6 8 12 16 24 32 48 64 96 128
100
+ );
101
+
102
+ // $$ Right margin
103
+ #stacks-internals #build-classes(
104
+ responsive,
105
+ '.mr',
106
+ { .template(@value) { margin-right: var(~"--su@{value}") !important; } },
107
+ 1 2 4 6 8 12 16 24 32 48 64 96 128
108
+ );
109
+
110
+ // $$ Right margin negative
111
+ #stacks-internals #build-classes(
112
+ responsive,
113
+ '.mrn',
114
+ { .template(@value) { margin-right: calc(var(~"--su@{value}") * -1) !important; } },
115
+ 1 2 4 6 8 12 16 24 32 48 64 96 128
116
+ );
117
+
118
+ // $$ Bottom margin
119
+ #stacks-internals #build-classes(
120
+ responsive,
121
+ '.mb',
122
+ { .template(@value) { margin-bottom: var(~"--su@{value}") !important; } },
123
+ 1 2 4 6 8 12 16 24 32 48 64 96 128
124
+ );
125
+
126
+ // $$ Bottom margin negative
127
+ #stacks-internals #build-classes(
128
+ responsive,
129
+ '.mbn',
130
+ { .template(@value) { margin-bottom: calc(var(~"--su@{value}") * -1) !important; } },
131
+ 1 2 4 6 8 12 16 24 32 48 64 96 128
132
+ );
133
+
134
+ // $$ Left margin
135
+ #stacks-internals #build-classes(
136
+ responsive,
137
+ '.ml',
138
+ { .template(@value) { margin-left: var(~"--su@{value}") !important; } },
139
+ 1 2 4 6 8 12 16 24 32 48 64 96 128
140
+ );
141
+
142
+ // $$ Left margin negative
143
+ #stacks-internals #build-classes(
144
+ responsive,
145
+ '.mln',
146
+ { .template(@value) { margin-left: calc(var(~"--su@{value}") * -1) !important; } },
147
+ 1 2 4 6 8 12 16 24 32 48 64 96 128
148
+ );
149
+
150
+ #stacks-internals #build-classes(
151
+ '.mx', { .template(@value) { margin-left: var(~"--su@{value}") !important; margin-right: var(~"--su@{value}") !important; } },
152
+ 1 2 4 6 8 12 16 24 32 48 64 96 128
153
+ );
154
+
155
+ #stacks-internals #build-classes(
156
+ '.my', { .template(@value) { margin-top: var(~"--su@{value}") !important; margin-bottom: var(~"--su@{value}") !important; } },
157
+ 1 2 4 6 8 12 16 24 32 48 64 96 128
158
+ );
159
+
160
+ // ============================================================================
161
+ // $ PADDING
162
+ // ----------------------------------------------------------------------------
163
+
164
+ // $$ 0 padding
165
+ .p0 { padding: 0 !important; }
166
+ .pt0 { padding-top: 0 !important; }
167
+ .pr0 { padding-right: 0 !important; }
168
+ .pb0 { padding-bottom: 0 !important; }
169
+ .pl0 { padding-left: 0 !important; }
170
+ .px0 { padding-left: 0 !important; padding-right: 0 !important; }
171
+ .py0 { padding-top: 0 !important; padding-bottom: 0 !important; }
172
+
173
+ #stacks-internals #build-classes(
174
+ responsive,
175
+ '.p', { .template(@value) { padding: var(~"--su@{value}") !important; } },
176
+ 1 2 4 6 8 12 16 24 32 48 64 96 128
177
+ );
178
+
179
+ // $$ Top Padding
180
+ #stacks-internals #build-classes(
181
+ responsive,
182
+ '.pt', { .template(@value) { padding-top: var(~"--su@{value}") !important; } },
183
+ 1 2 4 6 8 12 16 24 32 48 64 96 128
184
+ );
185
+
186
+ // $$ Right Padding
187
+ #stacks-internals #build-classes(
188
+ responsive,
189
+ '.pr', { .template(@value) { padding-right: var(~"--su@{value}") !important; } },
190
+ 1 2 4 6 8 12 16 24 32 48 64 96 128
191
+ );
192
+
193
+ // $$ Bottom Padding
194
+ #stacks-internals #build-classes(
195
+ responsive,
196
+ '.pb', { .template(@value) { padding-bottom: var(~"--su@{value}") !important; } },
197
+ 1 2 4 6 8 12 16 24 32 48 64 96 128
198
+ );
199
+
200
+ // $$ Left Padding
201
+ #stacks-internals #build-classes(
202
+ responsive,
203
+ '.pl', { .template(@value) { padding-left: var(~"--su@{value}") !important; } },
204
+ 1 2 4 6 8 12 16 24 32 48 64 96 128
205
+ );
206
+
207
+ // $$ X-Axis Padding
208
+ #stacks-internals #build-classes(
209
+ '.px', { .template(@value) { padding-left: var(~"--su@{value}") !important; padding-right: var(~"--su@{value}") !important; } },
210
+ 1 2 4 6 8 12 16 24 32 48 64 96 128
211
+ );
212
+
213
+ // $$ Y-Axis Padding
214
+ #stacks-internals #build-classes(
215
+ '.py', { .template(@value) { padding-top: var(~"--su@{value}") !important; padding-bottom: var(~"--su@{value}") !important; } },
216
+ 1 2 4 6 8 12 16 24 32 48 64 96 128
217
+ );
218
+
219
+ // ============================================================================
220
+ // $ POSITIONING
221
+ // ----------------------------------------------------------------------------
222
+
223
+ // $$ Top
224
+ #stacks-internals #build-classes(
225
+ responsive,
226
+ '.t', { .template(@value) { top: var(~"--su@{value}") !important; } },
227
+ 1 2 4 6 8 12 16 24 32 48 64 96 128
228
+ );
229
+
230
+ // $$ Top 0, percent
231
+ #stacks-internals #build-classes(
232
+ '.t', { .template(@value) { top: @value !important; } },
233
+ 0 50% -50% 100% -100%
234
+ );
235
+
236
+ // $$ Top negative
237
+ #stacks-internals #build-classes(
238
+ responsive,
239
+ '.tn', { .template(@value) { top: calc(var(~"--su@{value}") * -1) !important; } },
240
+ 1 2 4 6 8 12 16 24 32 48 64 96 128
241
+ );
242
+
243
+ // $$ Right
244
+ #stacks-internals #build-classes(
245
+ responsive,
246
+ '.r', { .template(@value) { right: var(~"--su@{value}") !important; } },
247
+ 1 2 4 6 8 12 16 24 32 48 64 96 128
248
+ );
249
+
250
+ // $$ Right 0, percent
251
+ #stacks-internals #build-classes(
252
+ '.r', { .template(@value) { right: @value !important; } },
253
+ 0 50% -50% 100% -100%
254
+ );
255
+
256
+ // $$ Right negative
257
+ #stacks-internals #build-classes(
258
+ responsive,
259
+ '.rn', { .template(@value) { right: calc(var(~"--su@{value}") * -1) !important; } },
260
+ 1 2 4 6 8 12 16 24 32 48 64 96 128
261
+ );
262
+
263
+ // $$ Bottom
264
+ #stacks-internals #build-classes(
265
+ responsive,
266
+ '.b', { .template(@value) { bottom: var(~"--su@{value}") !important; } },
267
+ 1 2 4 6 8 12 16 24 32 48 64 96 128
268
+ );
269
+
270
+ // $$ Bottom 0, percent
271
+ #stacks-internals #build-classes(
272
+ '.b', { .template(@value) { bottom: @value !important; } },
273
+ 0 50% -50% 100% -100%
274
+ );
275
+
276
+ // $$ Bottom negative
277
+ #stacks-internals #build-classes(
278
+ responsive,
279
+ '.bn', { .template(@value) { bottom: calc(var(~"--su@{value}") * -1) !important; } },
280
+ 1 2 4 6 8 12 16 24 32 48 64 96 128
281
+ );
282
+
283
+ // $$ Left
284
+ #stacks-internals #build-classes(
285
+ responsive,
286
+ '.l', { .template(@value) { left: var(~"--su@{value}") !important; } },
287
+ 1 2 4 6 8 12 16 24 32 48 64 96 128
288
+ );
289
+
290
+ // $$ Left 0, percent
291
+ #stacks-internals #build-classes(
292
+ '.l', { .template(@value) { left: @value !important; } },
293
+ 0 50% -50% 100% -100%
294
+ );
295
+
296
+ // $$ Left negative
297
+ #stacks-internals #build-classes(
298
+ responsive,
299
+ '.ln', { .template(@value) { left: calc(var(~"--su@{value}") * -1) !important; } },
300
+ 1 2 4 6 8 12 16 24 32 48 64 96 128
301
+ );
302
+
303
+ // $$ Inset
304
+ #stacks-internals #build-classes(
305
+ responsive,
306
+ '.i', { .template(@value) { inset: var(~"--su@{value}") !important; } },
307
+ 1 2 4 6 8 12 16 24 32 48 64 96 128
308
+ );
309
+
310
+ // $$ Inset 0
311
+ #stacks-internals #build-classes(
312
+ '.i', { .template(@value) { inset: @value !important; } },
313
+ 0
314
+ );