@nuvoui/core 1.1.7 → 1.2.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 (39) hide show
  1. package/README.md +90 -35
  2. package/dist/nuvoui.css +28531 -0
  3. package/dist/nuvoui.css.map +1 -0
  4. package/dist/nuvoui.min.css +2 -1
  5. package/dist/nuvoui.min.css.map +1 -0
  6. package/package.json +48 -27
  7. package/src/styles/abstracts/_config.scss +157 -0
  8. package/src/styles/abstracts/_functions.scss +81 -0
  9. package/src/styles/abstracts/_index.scss +2 -0
  10. package/src/styles/base/_base.scss +2 -2
  11. package/src/styles/base/_index.scss +2 -0
  12. package/src/styles/base/_reset.scss +8 -6
  13. package/src/styles/index.scss +11 -28
  14. package/src/styles/layouts/_container.scss +14 -22
  15. package/src/styles/layouts/_flex.scss +60 -18
  16. package/src/styles/layouts/_grid.scss +36 -28
  17. package/src/styles/layouts/_index.scss +3 -0
  18. package/src/styles/mixins-map.scss +877 -1225
  19. package/src/styles/themes/_index.scss +1 -0
  20. package/src/styles/themes/_theme.scss +175 -57
  21. package/src/styles/utilities/_alignment.scss +20 -0
  22. package/src/styles/utilities/_animations.scss +65 -61
  23. package/src/styles/utilities/_borders.scss +280 -16
  24. package/src/styles/utilities/_colors.scss +68 -49
  25. package/src/styles/utilities/_container-queries.scss +46 -7
  26. package/src/styles/utilities/_display.scss +57 -3
  27. package/src/styles/utilities/_helpers.scss +110 -108
  28. package/src/styles/utilities/_index.scss +19 -0
  29. package/src/styles/utilities/_media-queries.scss +54 -19
  30. package/src/styles/utilities/_opacity.scss +110 -8
  31. package/src/styles/utilities/_position.scss +177 -71
  32. package/src/styles/utilities/_shadows.scss +194 -67
  33. package/src/styles/utilities/_sizing.scss +62 -57
  34. package/src/styles/utilities/_spacing.scss +331 -64
  35. package/src/styles/utilities/_tooltips.scss +153 -105
  36. package/src/styles/utilities/_transitions.scss +152 -0
  37. package/src/styles/utilities/_typography.scss +113 -89
  38. package/src/styles/utilities/_functions.scss +0 -84
  39. package/src/styles/utilities/_variables.scss +0 -98
@@ -1,91 +1,96 @@
1
1
  // _spacing.scss
2
2
 
3
3
  @use 'sass:math';
4
- @use './variables' as *;
4
+ @use 'sass:string' as str;
5
+ @use '../abstracts' as VAR;
5
6
  @use './container-queries' as Q;
7
+ @use './media-queries' as MQ;
6
8
 
7
- @mixin width($value) { width: $value; }
8
- @mixin height($value) { height: $value; }
9
+ @mixin width($value) { & { width: $value; } }
10
+ @mixin height($value) { & { height: $value; } }
9
11
  @mixin min-width($value) { min-width: $value; }
10
12
  @mixin min-height($value) { min-height: $value; }
11
13
  @mixin max-width($value) { max-width: $value; }
12
14
  @mixin max-height($value) { max-height: $value; }
13
15
 
14
- @mixin width-percent($i) { width: #{$i + '%'}; }
15
- @mixin height-percent($i) { height: #{$i + '%'}; }
16
- @mixin min-width-percent($i) { min-width: #{$i + '%'}; }
17
- @mixin min-height-percent($i) { min-height: #{$i + '%'}; }
18
- @mixin max-width-percent($i) { max-width: #{$i + '%'}; }
19
- @mixin max-height-percent($i) { max-height: #{$i + '%'}; }
16
+ @mixin width-percent($i) { & { width: str.unquote($i + '%'); } }
17
+ @mixin height-percent($i) { & { height: str.unquote($i + '%'); } }
18
+ @mixin min-width-percent($i) { & { min-width: str.unquote($i + '%'); } }
19
+ @mixin min-height-percent($i) { & { min-height: str.unquote($i + '%'); } }
20
+ @mixin max-width-percent($i) { & { max-width: str.unquote($i + '%'); } }
21
+ @mixin max-height-percent($i) { & { max-height: str.unquote($i + '%'); } }
20
22
 
23
+ @mixin w-auto { & { width: auto; } }
24
+ @mixin w-full { & { width: 100%; } }
25
+ @mixin h-auto { & { height: auto; } }
26
+ @mixin h-full { & { height: 100%; } }
27
+ @mixin min-w-full { & { min-width: 100%; } }
28
+ @mixin max-w-full { & { max-width: 100%; } }
29
+ @mixin min-h-full { & { min-height: 100%; } }
30
+ @mixin max-h-full { & { max-height: 100%; } }
21
31
 
22
- @mixin w-auto { width: auto; }
23
- @mixin w-full { width: 100%; }
24
- @mixin h-auto { height: auto; }
25
- @mixin h-full { height: 100%; }
26
- @mixin min-w-full { min-width: 100%; }
27
- @mixin max-w-full { max-width: 100%; }
28
- @mixin min-h-full { min-height: 100%; }
29
- @mixin max-h-full { max-height: 100%; }
32
+ @mixin w-screen { & { width: 100vw; } }
33
+ @mixin h-screen { & { height: 100dvh; } }
30
34
 
35
+ .w-screen { @include w-screen; }
36
+ .h-screen { @include h-screen; }
37
+
38
+ // Width utilities need :not(.flex) to avoid conflicts with flex child sizing
31
39
  :not(.flex)>.w-auto { @include w-auto; }
32
40
  :not(.flex)>.w-full { @include w-full; }
33
41
 
34
42
  .h-auto { @include h-auto; }
35
43
  .h-full { @include h-full; }
36
- .min-w-full { @include min-w-full }
37
- .max-w-full { @include max-w-full }
38
- .min-h-full { @include min-h-full }
39
- .max-h-full { @include max-h-full }
44
+ .min-w-full { @include min-w-full; }
45
+ .max-w-full { @include max-w-full; }
46
+ .min-h-full { @include min-h-full; }
47
+ .max-h-full { @include max-h-full; }
40
48
 
41
49
  // Percentage widths
42
- @each $i in $percentages {
43
- .w-#{$i}per { @include width-percent($i); }
44
- .h-#{$i}per { @include height-percent($i); }
45
- .min-w-#{$i}per { @include min-width-percent($i); }
46
- .min-h-#{$i}per { @include min-height-percent($i); }
47
- .max-w-#{$i}per { @include max-width-percent($i); }
48
- .max-h-#{$i}per { @include max-height-percent($i); }
50
+ @each $i in VAR.$percentages {
51
+ .w-#{$i}p { @include width-percent($i); }
52
+ .h-#{$i}p { @include height-percent($i); }
53
+ .min-w-#{$i}p { @include min-width-percent($i); }
54
+ .min-h-#{$i}p { @include min-height-percent($i); }
55
+ .max-w-#{$i}p { @include max-width-percent($i); }
56
+ .max-h-#{$i}p { @include max-height-percent($i); }
49
57
  }
50
58
 
51
59
  // Generate utilities from spacing map
52
- @each $i in $spacings {
53
- .w-#{$i} { @include width($i); }
54
- .h-#{$i} { @include height($i); }
55
- .min-w-#{$i} { @include min-width($i) }
56
- .min-h-#{$i} { @include min-height($i) }
57
- .max-w-#{$i} { @include max-width($i) }
58
- .max-h-#{$i} { @include max-height($i) }
60
+ @each $key, $value in VAR.$spacings {
61
+ .w-#{$key} { @include width($value); }
62
+ .h-#{$key} { @include height($value); }
63
+ .min-w-#{$key} { @include min-width($value); }
64
+ .min-h-#{$key} { @include min-height($value); }
65
+ .max-w-#{$key} { @include max-width($value); }
66
+ .max-h-#{$key} { @include max-height($value); }
59
67
  }
60
68
 
61
69
  // Pixel widths based on spacing scale
62
- @each $breakpoint, $width in $breakpoints {
70
+ @each $breakpoint, $width in VAR.$breakpoints {
63
71
 
64
72
  .w-#{$breakpoint} { @include width($width); }
65
- .min-w-#{$breakpoint} { @include min-width($width) }
66
- .max-w-#{$breakpoint} { @include max-width($width) }
67
-
68
- @each $b, $w in $breakpoints {
69
- .min-w-#{$breakpoint}\@#{$b} { @include min-width($width) }
70
- .max-w-#{$breakpoint}\@#{$b} { @include max-width($width) }
71
- }
73
+ .min-w-#{$breakpoint} { @include min-width($width); }
74
+ .max-w-#{$breakpoint} { @include max-width($width); }
72
75
 
73
- @include Q.container-up ($breakpoint) {
76
+ @include MQ.media-up ($breakpoint) {
74
77
  // Generate utilities from spacing map
78
+ @each $i in VAR.$percentages {
79
+ .w-#{$i}p\@#{$breakpoint} { @include width-percent($i); }
80
+ .h-#{$i}p\@#{$breakpoint} { @include height-percent($i); }
81
+ .min-w-#{$i}p\@#{$breakpoint} { @include min-width-percent($i); }
82
+ .min-h-#{$i}p\@#{$breakpoint} { @include min-height-percent($i); }
83
+ .max-w-#{$i}p\@#{$breakpoint} { @include max-width-percent($i); }
84
+ .max-h-#{$i}p\@#{$breakpoint} { @include max-height-percent($i); }
85
+ }
75
86
 
76
- @each $i in $spacings {
77
- .w-#{$i}per\@#{$breakpoint} { @include width-percent($i); }
78
- .h-#{$i}per\@#{$breakpoint} { @include height-percent($i); }
79
- .min-w-#{$i}per\@#{$breakpoint} { @include min-width-percent($i); }
80
- .min-h-#{$i}per\@#{$breakpoint} { @include min-height-percent($i); }
81
- .max-w-#{$i}per\@#{$breakpoint} { @include max-width-percent($i); }
82
- .max-h-#{$i}per\@#{$breakpoint} { @include max-height-percent($i); }
83
- .w-#{$i}\@#{$breakpoint} { @include width($i); }
84
- .h-#{$i}\@#{$breakpoint} { @include height($i); }
85
- .min-w-#{$i}\@#{$breakpoint} { @include min-width($i) }
86
- .min-h-#{$i}\@#{$breakpoint} { @include min-height($i) }
87
- .max-w-#{$i}\@#{$breakpoint} { @include max-width($i) }
88
- .max-h-#{$i}\@#{$breakpoint} { @include max-height($i) }
87
+ @each $key, $value in VAR.$spacings {
88
+ .w-#{$key}\@#{$breakpoint} { @include width($value); }
89
+ .h-#{$key}\@#{$breakpoint} { @include height($value); }
90
+ .min-w-#{$key}\@#{$breakpoint} { @include min-width($value); }
91
+ .min-h-#{$key}\@#{$breakpoint} { @include min-height($value); }
92
+ .max-w-#{$key}\@#{$breakpoint} { @include max-width($value); }
93
+ .max-h-#{$key}\@#{$breakpoint} { @include max-height($value); }
89
94
  }
90
95
  }
91
96
  }
@@ -1,7 +1,89 @@
1
1
  @use 'sass:math';
2
2
  @use 'sass:string';
3
3
  @use 'sass:meta';
4
- @use './variables' as *;
4
+ @use '../abstracts' as *;
5
+
6
+
7
+ /**
8
+ * @component Spacing
9
+ * @description Controls element margins, padding, gaps, and spacing between children
10
+ *
11
+ * @example
12
+ * <!-- Padding -->
13
+ * <div class="p-4">All sides padding</div>
14
+ * <div class="px-4 py-2">Horizontal and vertical padding</div>
15
+ * <div class="pt-2 pb-4">Top and bottom padding</div>
16
+ *
17
+ * <!-- Margins -->
18
+ * <div class="m-4">All sides margin</div>
19
+ * <div class="mt-4">Top margin only</div>
20
+ * <div class="mx-auto">Horizontally centered</div>
21
+ *
22
+ * <!-- Gap (for flex/grid containers) -->
23
+ * <div class="flex gap-4">
24
+ * <div>Item 1</div>
25
+ * <div>Item 2</div>
26
+ * </div>
27
+ *
28
+ * <!-- Responsive spacing -->
29
+ * <div class="p-2 p-4@md p-6@lg">
30
+ * Padding increases at each breakpoint
31
+ * </div>
32
+ *
33
+ * <!-- Child spacing -->
34
+ * <div class="space-y-4">
35
+ * <div>First child</div>
36
+ * <div>Second child (margin-top: 1rem)</div>
37
+ * <div>Third child (margin-top: 1rem)</div>
38
+ * </div>
39
+ *
40
+ * @classes
41
+ * Padding:
42
+ * - p-{size}: Padding on all sides
43
+ * - px-{size}: Horizontal padding (left and right)
44
+ * - py-{size}: Vertical padding (top and bottom)
45
+ * - pt-{size}, pr-{size}, pb-{size}, pl-{size}: Individual side padding
46
+ *
47
+ * Margin:
48
+ * - m-{size}: Margin on all sides
49
+ * - mx-{size}: Horizontal margin (left and right)
50
+ * - my-{size}: Vertical margin (top and bottom)
51
+ * - mt-{size}, mr-{size}, mb-{size}, ml-{size}: Individual side margin
52
+ * - mx-auto, ml-auto, mr-auto: Auto margin for alignment
53
+ *
54
+ * Gap:
55
+ * - gap-{size}: Gap between flex/grid children (all directions)
56
+ * - gap-x-{size}: Horizontal gap between children (column-gap)
57
+ * - gap-y-{size}: Vertical gap between children (row-gap)
58
+ *
59
+ * Child Spacing:
60
+ * - space-x-{size}: Horizontal space between children
61
+ * - space-y-{size}: Vertical space between children
62
+ *
63
+ * @responsive
64
+ * All spacing classes support responsive variants using @breakpoint suffix:
65
+ * - p-4@md: 1rem padding on medium screens and up
66
+ * - mt-8@lg: 2rem top margin on large screens
67
+ * - gap-2@xl: 0.5rem gap on extra large screens
68
+ *
69
+ * @customization
70
+ * Spacing values are defined in the $spacings map in variables.scss
71
+ * Typically follows a scale where higher numbers mean more spacing
72
+ *
73
+ * @see flex, grid, display
74
+ */
75
+
76
+ // -----------------------------------------------
77
+ // HELPER FUNCTIONS
78
+ // -----------------------------------------------
79
+
80
+ /**
81
+ * @function format-unit-value
82
+ * @description Ensures values have appropriate units
83
+ * @param {Number|String} $value - The value to format
84
+ * @returns {Number|String} Value with appropriate units
85
+ * @internal
86
+ */
5
87
 
6
88
  @function format-unit-value($value) {
7
89
  // Zero check
@@ -9,9 +91,14 @@
9
91
  @return 0;
10
92
  }
11
93
 
12
- // If pure number, add px
13
- @if meta.type-of($value) == 'number' {
14
- @return $value + px;
94
+ // If pure number (no units), add px
95
+ @if meta.type-of($value) == 'number' and math.unit($value) == "" {
96
+ @return $value * 1px; // Multiply by 1px instead of adding px
97
+ }
98
+
99
+ // If number with units (like rem), return as is
100
+ @if meta.type-of($value) == 'number' and math.unit($value) != "" {
101
+ @return $value; // Already has units, return as is
15
102
  }
16
103
 
17
104
  // Convert value to string for unit checking
@@ -20,78 +107,259 @@
20
107
  @return $value-str;
21
108
  }
22
109
 
23
- // Padding mixins
24
- @mixin p($val) { padding: format-unit-value($val); }
25
- @mixin px($val) { $val: format-unit-value($val); padding-left: $val; padding-right: $val; }
26
- @mixin py($val) { $val: format-unit-value($val); padding-top: $val; padding-bottom: $val; }
110
+
111
+ // -----------------------------------------------
112
+ // PADDING MIXINS
113
+ // -----------------------------------------------
114
+
115
+ /**
116
+ * @mixin p
117
+ * @description Sets padding on all sides
118
+ * @param {Number|String} $val - Padding value
119
+ */
120
+ @mixin p($val) { & { padding: format-unit-value($val); }}
121
+
122
+ /**
123
+ * @mixin px
124
+ * @description Sets horizontal padding (left and right)
125
+ * @param {Number|String} $val - Padding value
126
+ */
127
+ @mixin px($val) {
128
+ $val: format-unit-value($val);
129
+
130
+ padding-left: $val;
131
+ padding-right: $val;
132
+ }
133
+
134
+ /**
135
+ * @mixin py
136
+ * @description Sets vertical padding (top and bottom)
137
+ * @param {Number|String} $val - Padding value
138
+ */
139
+ @mixin py($val) {
140
+ $val: format-unit-value($val);
141
+
142
+ padding-top: $val;
143
+ padding-bottom: $val;
144
+ }
145
+
146
+ /**
147
+ * @mixin pt
148
+ * @description Sets padding-top
149
+ * @param {Number|String} $val - Padding value
150
+ */
27
151
  @mixin pt($val) { $val: format-unit-value($val); padding-top: $val; }
152
+
153
+ /**
154
+ * @mixin pr
155
+ * @description Sets padding-right
156
+ * @param {Number|String} $val - Padding value
157
+ */
28
158
  @mixin pr($val) { $val: format-unit-value($val); padding-right: $val; }
159
+
160
+ /**
161
+ * @mixin pb
162
+ * @description Sets padding-bottom
163
+ * @param {Number|String} $val - Padding value
164
+ */
29
165
  @mixin pb($val) { $val: format-unit-value($val); padding-bottom: $val; }
166
+
167
+ /**
168
+ * @mixin pl
169
+ * @description Sets padding-left
170
+ * @param {Number|String} $val - Padding value
171
+ */
30
172
  @mixin pl($val) { $val: format-unit-value($val); padding-left: $val; }
31
173
 
32
- // Margin mixins
174
+ // -----------------------------------------------
175
+ // MARGIN MIXINS
176
+ // -----------------------------------------------
177
+
178
+ /**
179
+ * @mixin m
180
+ * @description Sets margin on all sides
181
+ * @param {Number|String} $val - Margin value
182
+ */
33
183
  @mixin m($val) { $val: format-unit-value($val); margin: $val; }
34
- @mixin mx($val) { $val: format-unit-value($val); margin-left: $val; margin-right: $val; }
35
- @mixin my($val) { $val: format-unit-value($val); margin-top: $val; margin-bottom: $val; }
184
+
185
+ /**
186
+ * @mixin mx
187
+ * @description Sets horizontal margin (left and right)
188
+ * @param {Number|String} $val - Margin value
189
+ */
190
+ @mixin mx($val) {
191
+ $val: format-unit-value($val);
192
+
193
+ margin-left: $val;
194
+ margin-right: $val;
195
+ }
196
+
197
+ /**
198
+ * @mixin my
199
+ * @description Sets vertical margin (top and bottom)
200
+ * @param {Number|String} $val - Margin value
201
+ */
202
+ @mixin my($val) {
203
+ $val: format-unit-value($val);
204
+
205
+ margin-top: $val;
206
+ margin-bottom: $val;
207
+ }
208
+
209
+ /**
210
+ * @mixin mt
211
+ * @description Sets margin-top
212
+ * @param {Number|String} $val - Margin value
213
+ */
36
214
  @mixin mt($val) { $val: format-unit-value($val); margin-top: $val; }
215
+
216
+ /**
217
+ * @mixin mr
218
+ * @description Sets margin-right
219
+ * @param {Number|String} $val - Margin value
220
+ */
37
221
  @mixin mr($val) { $val: format-unit-value($val); margin-right: $val; }
222
+
223
+ /**
224
+ * @mixin mb
225
+ * @description Sets margin-bottom
226
+ * @param {Number|String} $val - Margin value
227
+ */
38
228
  @mixin mb($val) { $val: format-unit-value($val); margin-bottom: $val; }
229
+
230
+ /**
231
+ * @mixin ml
232
+ * @description Sets margin-left
233
+ * @param {Number|String} $val - Margin value
234
+ */
39
235
  @mixin ml($val) { $val: format-unit-value($val); margin-left: $val; }
40
236
 
41
- // Auto margin utilities
237
+ /**
238
+ * @mixin ml-auto
239
+ * @description Sets margin-left to auto
240
+ */
42
241
  @mixin ml-auto { margin-left: auto; }
242
+
243
+ /**
244
+ * @mixin mr-auto
245
+ * @description Sets margin-right to auto
246
+ */
43
247
  @mixin mr-auto { margin-right: auto; }
248
+
249
+ /**
250
+ * @mixin mx-auto
251
+ * @description Centers element horizontally using auto margins
252
+ */
44
253
  @mixin mx-auto { @include ml-auto; @include mr-auto; }
45
254
 
46
- // Spacing map
47
- @mixin space-y($i) { & > * + * { margin-top: if($i == 0, 0, $i + px); } }
48
- @mixin space-x($i) { & > * + * { margin-left: if($i == 0, 0, $i + px); } }
49
255
 
256
+ // -----------------------------------------------
257
+ // SPACING MIXINS
258
+ // -----------------------------------------------
259
+
260
+ /**
261
+ * @mixin space-y
262
+ * @description Adds vertical spacing between direct children
263
+ * @param {Number|String} $i - Space amount
264
+ */
265
+ @mixin space-y($i) {
266
+ & > * + * {
267
+ $i: format-unit-value($i);
268
+
269
+ margin-top: $i;
270
+ }
271
+ }
272
+
273
+ /**
274
+ * @mixin space-x
275
+ * @description Adds horizontal spacing between direct children
276
+ * @param {Number|String} $i - Space amount
277
+ */
278
+ @mixin space-x($i) {
279
+ & > * + * {
280
+ $i: format-unit-value($i);
281
+
282
+ margin-left: $i;
283
+ }
284
+ }
285
+
286
+ // -----------------------------------------------
287
+ // GAP MIXINS
288
+ // -----------------------------------------------
289
+
290
+ /**
291
+ * @mixin gap
292
+ * @description Sets gap between grid/flex children
293
+ * @param {Number|String} $val - Gap value
294
+ */
295
+ @mixin gap($val) { $val: format-unit-value($val); gap: $val; }
50
296
 
51
- // Gap Mixins
52
- @mixin gap($value) { gap: if($value == 0, $value, $value + px); }
53
- @mixin gap-x($value) { column-gap: if($value == 0, $value, $value + px); }
54
- @mixin gap-y($value) { row-gap: if($value == 0, $value, $value + px); }
297
+ /**
298
+ * @mixin gap-x
299
+ * @description Sets horizontal gap between grid/flex children
300
+ * @param {Number|String} $val - Gap value
301
+ */
302
+ @mixin gap-x($val) { $val: format-unit-value($val); column-gap: $val; }
303
+
304
+ /**
305
+ * @mixin gap-y
306
+ * @description Sets vertical gap between grid/flex children
307
+ * @param {Number|String} $val - Gap value
308
+ */
309
+ @mixin gap-y($val) { $val: format-unit-value($val); row-gap: $val; }
310
+
311
+ // -----------------------------------------------
312
+ // AUTO MARGIN UTILITY CLASSES
313
+ // -----------------------------------------------
55
314
 
56
315
  .mx-auto { @include mx-auto; }
57
316
  .ml-auto { @include ml-auto; }
58
317
  .mr-auto { @include mr-auto; }
59
318
 
60
- // Gap Classes
319
+ // -----------------------------------------------
320
+ // GAP AUTO CLASS
321
+ // -----------------------------------------------
322
+
61
323
  .gap-auto { gap: auto; }
62
324
 
63
- // Generate utilities from spacing map
64
- @each $i in $spacings {
325
+ // -----------------------------------------------
326
+ // SPACING CLASSES
327
+ // -----------------------------------------------
328
+
329
+ @each $key, $value in $spacings {
65
330
  // Padding classes
66
- .p-#{$i} { @include p($i); }
67
- .px-#{$i} { @include px($i); }
68
- .py-#{$i} { @include py($i); }
69
- .pt-#{$i} { @include pt($i); }
70
- .pr-#{$i} { @include pr($i); }
71
- .pb-#{$i} { @include pb($i); }
72
- .pl-#{$i} { @include pl($i); }
331
+ .p-#{$key} { @include p($value); }
332
+ .px-#{$key} { @include px($value); }
333
+ .py-#{$key} { @include py($value); }
334
+ .pt-#{$key} { @include pt($value); }
335
+ .pr-#{$key} { @include pr($value); }
336
+ .pb-#{$key} { @include pb($value); }
337
+ .pl-#{$key} { @include pl($value); }
73
338
 
74
339
  // Margin classes
75
- .m-#{$i} { @include m($i); }
76
- .mx-#{$i} { @include mx($i); }
77
- .my-#{$i} { @include my($i); }
78
- .mt-#{$i} { @include mt($i); }
79
- .mr-#{$i} { @include mr($i); }
80
- .mb-#{$i} { @include mb($i); }
81
- .ml-#{$i} { @include ml($i); }
340
+ .m-#{$key} { @include m($value); }
341
+ .mx-#{$key} { @include mx($value); }
342
+ .my-#{$key} { @include my($value); }
343
+ .mt-#{$key} { @include mt($value); }
344
+ .mr-#{$key} { @include mr($value); }
345
+ .mb-#{$key} { @include mb($value); }
346
+ .ml-#{$key} { @include ml($value); }
82
347
 
83
348
  // Gap classes
84
- .gap-#{$i} { @include gap($i); }
85
- .gap-x-#{$i} { @include gap-x($i); }
86
- .gap-y-#{$i} { @include gap-y($i); }
349
+ .gap-#{$key} { @include gap($value); }
350
+ .gap-x-#{$key} { @include gap-x($value); }
351
+ .gap-y-#{$key} { @include gap-y($value); }
87
352
 
88
353
  // Space classes
89
- .space-x-#{$i} { @include space-x($i); }
90
- .space-y-#{$i} { @include space-y($i); }
354
+ .space-x-#{$key} { @include space-x($value); }
355
+ .space-y-#{$key} { @include space-y($value); }
91
356
  }
92
357
 
93
358
 
94
- // Responsive Position Classes
359
+ // -----------------------------------------------
360
+ // RESPONSIVE SPACING CLASSES
361
+ // -----------------------------------------------
362
+
95
363
  @each $breakpoint, $width in $breakpoints {
96
364
  @media (min-width: #{$width}) {
97
365
  .mx-auto\@#{$breakpoint} { @include mx-auto; }
@@ -99,33 +367,32 @@
99
367
  .mr-auto\@#{$breakpoint} { @include mr-auto; }
100
368
 
101
369
  // Generate utilities from spacing map
102
- @each $i in $spacings {
370
+ @each $key, $value in $spacings {
103
371
  // Padding classes
104
- .p-#{$i}\@#{$breakpoint} { @include p($i); }
105
- .px-#{$i}\@#{$breakpoint} { @include px($i); }
106
- .py-#{$i}\@#{$breakpoint} { @include py($i); }
107
- .pt-#{$i}\@#{$breakpoint} { @include pt($i); }
108
- .pr-#{$i}\@#{$breakpoint} { @include pr($i); }
109
- .pb-#{$i}\@#{$breakpoint} { @include pb($i); }
110
- .pl-#{$i}\@#{$breakpoint} { @include pl($i); }
372
+ .p-#{$key}\@#{$breakpoint} { @include p($value); }
373
+ .px-#{$key}\@#{$breakpoint} { @include px($value); }
374
+ .py-#{$key}\@#{$breakpoint} { @include py($value); }
375
+ .pt-#{$key}\@#{$breakpoint} { @include pt($value); }
376
+ .pr-#{$key}\@#{$breakpoint} { @include pr($value); }
377
+ .pb-#{$key}\@#{$breakpoint} { @include pb($value); }
378
+ .pl-#{$key}\@#{$breakpoint} { @include pl($value); }
111
379
 
112
380
  // Margin classes
113
- .m-#{$i}\@#{$breakpoint} { @include m($i); }
114
- .mx-#{$i}\@#{$breakpoint} { @include mx($i); }
115
- .my-#{$i}\@#{$breakpoint} { @include my($i); }
116
- .mt-#{$i}\@#{$breakpoint} { @include mt($i); }
117
- .mr-#{$i}\@#{$breakpoint} { @include mr($i); }
118
- .mb-#{$i}\@#{$breakpoint} { @include mb($i); }
119
- .ml-#{$i}\@#{$breakpoint} { @include ml($i); }
120
-
121
- .gap-#{$i}\@#{$breakpoint} { gap: $i; }
122
- .gap-x-#{$i}\@#{$breakpoint} { column-gap: $i; }
123
- .gap-y-#{$i}\@#{$breakpoint} { row-gap: $i; }
381
+ .m-#{$key}\@#{$breakpoint} { @include m($value); }
382
+ .mx-#{$key}\@#{$breakpoint} { @include mx($value); }
383
+ .my-#{$key}\@#{$breakpoint} { @include my($value); }
384
+ .mt-#{$key}\@#{$breakpoint} { @include mt($value); }
385
+ .mr-#{$key}\@#{$breakpoint} { @include mr($value); }
386
+ .mb-#{$key}\@#{$breakpoint} { @include mb($value); }
387
+ .ml-#{$key}\@#{$breakpoint} { @include ml($value); }
388
+
389
+ .gap-#{$key}\@#{$breakpoint} { gap: $value; }
390
+ .gap-x-#{$key}\@#{$breakpoint} { column-gap: $value; }
391
+ .gap-y-#{$key}\@#{$breakpoint} { row-gap: $value; }
124
392
 
125
-
126
393
  // Space classes
127
- .space-x-#{$i}\@#{$breakpoint} { @include space-x($i); }
128
- .space-y-#{$i}\@#{$breakpoint} { @include space-y($i); }
394
+ .space-x-#{$key}\@#{$breakpoint} { @include space-x($value); }
395
+ .space-y-#{$key}\@#{$breakpoint} { @include space-y($value); }
129
396
  }
130
397
  }
131
398
  }