@nuvoui/core 1.2.0 → 1.2.2

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.
@@ -32,65 +32,67 @@
32
32
  @mixin w-screen { & { width: 100vw; } }
33
33
  @mixin h-screen { & { height: 100dvh; } }
34
34
 
35
- .w-screen { @include w-screen; }
36
- .h-screen { @include h-screen; }
35
+ @if VAR.$generate-utility-classes {
36
+ .w-screen { @include w-screen; }
37
+ .h-screen { @include h-screen; }
37
38
 
38
- // Width utilities need :not(.flex) to avoid conflicts with flex child sizing
39
- :not(.flex)>.w-auto { @include w-auto; }
40
- :not(.flex)>.w-full { @include w-full; }
39
+ // Width utilities need :not(.flex) to avoid conflicts with flex child sizing
40
+ :not(.flex)>.w-auto { @include w-auto; }
41
+ :not(.flex)>.w-full { @include w-full; }
41
42
 
42
- .h-auto { @include h-auto; }
43
- .h-full { @include 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; }
43
+ .h-auto { @include h-auto; }
44
+ .h-full { @include h-full; }
45
+ .min-w-full { @include min-w-full; }
46
+ .max-w-full { @include max-w-full; }
47
+ .min-h-full { @include min-h-full; }
48
+ .max-h-full { @include max-h-full; }
48
49
 
49
- // Percentage widths
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); }
57
- }
50
+ // Percentage widths
51
+ @each $i in VAR.$percentages {
52
+ .w-#{$i}p { @include width-percent($i); }
53
+ .h-#{$i}p { @include height-percent($i); }
54
+ .min-w-#{$i}p { @include min-width-percent($i); }
55
+ .min-h-#{$i}p { @include min-height-percent($i); }
56
+ .max-w-#{$i}p { @include max-width-percent($i); }
57
+ .max-h-#{$i}p { @include max-height-percent($i); }
58
+ }
58
59
 
59
- // Generate utilities from spacing map
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); }
67
- }
60
+ // Generate utilities from spacing map
61
+ @each $key, $value in VAR.$spacings {
62
+ .w-#{$key} { @include width($value); }
63
+ .h-#{$key} { @include height($value); }
64
+ .min-w-#{$key} { @include min-width($value); }
65
+ .min-h-#{$key} { @include min-height($value); }
66
+ .max-w-#{$key} { @include max-width($value); }
67
+ .max-h-#{$key} { @include max-height($value); }
68
+ }
68
69
 
69
- // Pixel widths based on spacing scale
70
- @each $breakpoint, $width in VAR.$breakpoints {
70
+ // Pixel widths based on spacing scale
71
+ @each $breakpoint, $width in VAR.$breakpoints {
71
72
 
72
- .w-#{$breakpoint} { @include width($width); }
73
- .min-w-#{$breakpoint} { @include min-width($width); }
74
- .max-w-#{$breakpoint} { @include max-width($width); }
73
+ .w-#{$breakpoint} { @include width($width); }
74
+ .min-w-#{$breakpoint} { @include min-width($width); }
75
+ .max-w-#{$breakpoint} { @include max-width($width); }
75
76
 
76
- @include MQ.media-up ($breakpoint) {
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
- }
77
+ @include MQ.media-up ($breakpoint) {
78
+ // Generate utilities from spacing map
79
+ @each $i in VAR.$percentages {
80
+ .w-#{$i}p\@#{$breakpoint} { @include width-percent($i); }
81
+ .h-#{$i}p\@#{$breakpoint} { @include height-percent($i); }
82
+ .min-w-#{$i}p\@#{$breakpoint} { @include min-width-percent($i); }
83
+ .min-h-#{$i}p\@#{$breakpoint} { @include min-height-percent($i); }
84
+ .max-w-#{$i}p\@#{$breakpoint} { @include max-width-percent($i); }
85
+ .max-h-#{$i}p\@#{$breakpoint} { @include max-height-percent($i); }
86
+ }
86
87
 
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); }
88
+ @each $key, $value in VAR.$spacings {
89
+ .w-#{$key}\@#{$breakpoint} { @include width($value); }
90
+ .h-#{$key}\@#{$breakpoint} { @include height($value); }
91
+ .min-w-#{$key}\@#{$breakpoint} { @include min-width($value); }
92
+ .min-h-#{$key}\@#{$breakpoint} { @include min-height($value); }
93
+ .max-w-#{$key}\@#{$breakpoint} { @include max-width($value); }
94
+ .max-h-#{$key}\@#{$breakpoint} { @include max-height($value); }
95
+ }
94
96
  }
95
97
  }
96
98
  }
@@ -126,9 +126,11 @@
126
126
  */
127
127
  @mixin px($val) {
128
128
  $val: format-unit-value($val);
129
-
130
- padding-left: $val;
131
- padding-right: $val;
129
+
130
+ & {
131
+ padding-left: $val;
132
+ padding-right: $val;
133
+ }
132
134
  }
133
135
 
134
136
  /**
@@ -138,38 +140,64 @@
138
140
  */
139
141
  @mixin py($val) {
140
142
  $val: format-unit-value($val);
141
-
142
- padding-top: $val;
143
- padding-bottom: $val;
144
- }
145
143
 
144
+ & {
145
+ padding-top: $val;
146
+ padding-bottom: $val;
147
+ }
148
+ }
149
+
146
150
  /**
147
151
  * @mixin pt
148
152
  * @description Sets padding-top
149
153
  * @param {Number|String} $val - Padding value
150
154
  */
151
- @mixin pt($val) { $val: format-unit-value($val); padding-top: $val; }
155
+ @mixin pt($val) {
156
+ & {
157
+ $val: format-unit-value($val);
158
+
159
+ padding-top: $val;
160
+ }
161
+ }
152
162
 
153
163
  /**
154
164
  * @mixin pr
155
165
  * @description Sets padding-right
156
166
  * @param {Number|String} $val - Padding value
157
167
  */
158
- @mixin pr($val) { $val: format-unit-value($val); padding-right: $val; }
168
+ @mixin pr($val) {
169
+ & {
170
+ $val: format-unit-value($val);
171
+
172
+ padding-right: $val;
173
+ }
174
+ }
159
175
 
160
176
  /**
161
177
  * @mixin pb
162
178
  * @description Sets padding-bottom
163
179
  * @param {Number|String} $val - Padding value
164
180
  */
165
- @mixin pb($val) { $val: format-unit-value($val); padding-bottom: $val; }
181
+ @mixin pb($val) {
182
+ & {
183
+ $val: format-unit-value($val);
184
+
185
+ padding-bottom: $val;
186
+ }
187
+ }
166
188
 
167
189
  /**
168
190
  * @mixin pl
169
191
  * @description Sets padding-left
170
192
  * @param {Number|String} $val - Padding value
171
193
  */
172
- @mixin pl($val) { $val: format-unit-value($val); padding-left: $val; }
194
+ @mixin pl($val) {
195
+ & {
196
+ $val: format-unit-value($val);
197
+
198
+ padding-left: $val;
199
+ }
200
+ }
173
201
 
174
202
  // -----------------------------------------------
175
203
  // MARGIN MIXINS
@@ -180,7 +208,13 @@
180
208
  * @description Sets margin on all sides
181
209
  * @param {Number|String} $val - Margin value
182
210
  */
183
- @mixin m($val) { $val: format-unit-value($val); margin: $val; }
211
+ @mixin m($val) {
212
+ & {
213
+ $val: format-unit-value($val);
214
+
215
+ margin: $val;
216
+ }
217
+ }
184
218
 
185
219
  /**
186
220
  * @mixin mx
@@ -189,9 +223,11 @@
189
223
  */
190
224
  @mixin mx($val) {
191
225
  $val: format-unit-value($val);
192
-
193
- margin-left: $val;
194
- margin-right: $val;
226
+
227
+ & {
228
+ margin-left: $val;
229
+ margin-right: $val;
230
+ }
195
231
  }
196
232
 
197
233
  /**
@@ -202,8 +238,10 @@
202
238
  @mixin my($val) {
203
239
  $val: format-unit-value($val);
204
240
 
205
- margin-top: $val;
206
- margin-bottom: $val;
241
+ &{
242
+ margin-top: $val;
243
+ margin-bottom: $val;
244
+ }
207
245
  }
208
246
 
209
247
  /**
@@ -211,40 +249,64 @@
211
249
  * @description Sets margin-top
212
250
  * @param {Number|String} $val - Margin value
213
251
  */
214
- @mixin mt($val) { $val: format-unit-value($val); margin-top: $val; }
252
+ @mixin mt($val) {
253
+ & {
254
+ $val: format-unit-value($val);
255
+
256
+ margin-top: $val;
257
+ }
258
+ }
215
259
 
216
260
  /**
217
261
  * @mixin mr
218
262
  * @description Sets margin-right
219
263
  * @param {Number|String} $val - Margin value
220
264
  */
221
- @mixin mr($val) { $val: format-unit-value($val); margin-right: $val; }
265
+ @mixin mr($val) {
266
+ & {
267
+ $val: format-unit-value($val);
268
+
269
+ margin-right: $val;
270
+ }
271
+ }
222
272
 
223
273
  /**
224
274
  * @mixin mb
225
275
  * @description Sets margin-bottom
226
276
  * @param {Number|String} $val - Margin value
227
277
  */
228
- @mixin mb($val) { $val: format-unit-value($val); margin-bottom: $val; }
278
+ @mixin mb($val) {
279
+ & {
280
+ $val: format-unit-value($val);
281
+
282
+ margin-bottom: $val;
283
+ }
284
+ }
229
285
 
230
286
  /**
231
287
  * @mixin ml
232
288
  * @description Sets margin-left
233
289
  * @param {Number|String} $val - Margin value
234
290
  */
235
- @mixin ml($val) { $val: format-unit-value($val); margin-left: $val; }
291
+ @mixin ml($val) {
292
+ & {
293
+ $val: format-unit-value($val);
294
+
295
+ margin-left: $val;
296
+ }
297
+ }
236
298
 
237
299
  /**
238
300
  * @mixin ml-auto
239
301
  * @description Sets margin-left to auto
240
302
  */
241
- @mixin ml-auto { margin-left: auto; }
303
+ @mixin ml-auto { & { margin-left: auto; } }
242
304
 
243
305
  /**
244
306
  * @mixin mr-auto
245
307
  * @description Sets margin-right to auto
246
308
  */
247
- @mixin mr-auto { margin-right: auto; }
309
+ @mixin mr-auto { & { margin-right: auto; } }
248
310
 
249
311
  /**
250
312
  * @mixin mx-auto
@@ -308,91 +370,93 @@
308
370
  */
309
371
  @mixin gap-y($val) { $val: format-unit-value($val); row-gap: $val; }
310
372
 
311
- // -----------------------------------------------
312
- // AUTO MARGIN UTILITY CLASSES
313
- // -----------------------------------------------
314
-
315
- .mx-auto { @include mx-auto; }
316
- .ml-auto { @include ml-auto; }
317
- .mr-auto { @include mr-auto; }
318
-
319
- // -----------------------------------------------
320
- // GAP AUTO CLASS
321
- // -----------------------------------------------
322
-
323
- .gap-auto { gap: auto; }
324
-
325
- // -----------------------------------------------
326
- // SPACING CLASSES
327
- // -----------------------------------------------
328
-
329
- @each $key, $value in $spacings {
330
- // Padding classes
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); }
338
-
339
- // Margin classes
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); }
347
-
348
- // Gap classes
349
- .gap-#{$key} { @include gap($value); }
350
- .gap-x-#{$key} { @include gap-x($value); }
351
- .gap-y-#{$key} { @include gap-y($value); }
352
-
353
- // Space classes
354
- .space-x-#{$key} { @include space-x($value); }
355
- .space-y-#{$key} { @include space-y($value); }
356
- }
357
-
373
+ @if $generate-utility-classes {
374
+ // -----------------------------------------------
375
+ // AUTO MARGIN UTILITY CLASSES
376
+ // -----------------------------------------------
377
+
378
+ .mx-auto { @include mx-auto; }
379
+ .ml-auto { @include ml-auto; }
380
+ .mr-auto { @include mr-auto; }
381
+
382
+ // -----------------------------------------------
383
+ // GAP AUTO CLASS
384
+ // -----------------------------------------------
385
+
386
+ .gap-auto { gap: auto; }
387
+
388
+ // -----------------------------------------------
389
+ // SPACING CLASSES
390
+ // -----------------------------------------------
391
+
392
+ @each $key, $value in $spacings {
393
+ // Padding classes
394
+ .p-#{$key} { @include p($value); }
395
+ .px-#{$key} { @include px($value); }
396
+ .py-#{$key} { @include py($value); }
397
+ .pt-#{$key} { @include pt($value); }
398
+ .pr-#{$key} { @include pr($value); }
399
+ .pb-#{$key} { @include pb($value); }
400
+ .pl-#{$key} { @include pl($value); }
401
+
402
+ // Margin classes
403
+ .m-#{$key} { @include m($value); }
404
+ .mx-#{$key} { @include mx($value); }
405
+ .my-#{$key} { @include my($value); }
406
+ .mt-#{$key} { @include mt($value); }
407
+ .mr-#{$key} { @include mr($value); }
408
+ .mb-#{$key} { @include mb($value); }
409
+ .ml-#{$key} { @include ml($value); }
410
+
411
+ // Gap classes
412
+ .gap-#{$key} { @include gap($value); }
413
+ .gap-x-#{$key} { @include gap-x($value); }
414
+ .gap-y-#{$key} { @include gap-y($value); }
415
+
416
+ // Space classes
417
+ .space-x-#{$key} { @include space-x($value); }
418
+ .space-y-#{$key} { @include space-y($value); }
419
+ }
358
420
 
359
- // -----------------------------------------------
360
- // RESPONSIVE SPACING CLASSES
361
- // -----------------------------------------------
362
421
 
363
- @each $breakpoint, $width in $breakpoints {
364
- @media (min-width: #{$width}) {
365
- .mx-auto\@#{$breakpoint} { @include mx-auto; }
366
- .ml-auto\@#{$breakpoint} { @include ml-auto; }
367
- .mr-auto\@#{$breakpoint} { @include mr-auto; }
368
-
369
- // Generate utilities from spacing map
370
- @each $key, $value in $spacings {
371
- // Padding classes
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); }
379
-
380
- // Margin classes
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; }
392
-
393
- // Space classes
394
- .space-x-#{$key}\@#{$breakpoint} { @include space-x($value); }
395
- .space-y-#{$key}\@#{$breakpoint} { @include space-y($value); }
396
- }
397
- }
422
+ // -----------------------------------------------
423
+ // RESPONSIVE SPACING CLASSES
424
+ // -----------------------------------------------
425
+
426
+ @each $breakpoint, $width in $breakpoints {
427
+ @media (min-width: #{$width}) {
428
+ .mx-auto\@#{$breakpoint} { @include mx-auto; }
429
+ .ml-auto\@#{$breakpoint} { @include ml-auto; }
430
+ .mr-auto\@#{$breakpoint} { @include mr-auto; }
431
+
432
+ // Generate utilities from spacing map
433
+ @each $key, $value in $spacings {
434
+ // Padding classes
435
+ .p-#{$key}\@#{$breakpoint} { @include p($value); }
436
+ .px-#{$key}\@#{$breakpoint} { @include px($value); }
437
+ .py-#{$key}\@#{$breakpoint} { @include py($value); }
438
+ .pt-#{$key}\@#{$breakpoint} { @include pt($value); }
439
+ .pr-#{$key}\@#{$breakpoint} { @include pr($value); }
440
+ .pb-#{$key}\@#{$breakpoint} { @include pb($value); }
441
+ .pl-#{$key}\@#{$breakpoint} { @include pl($value); }
442
+
443
+ // Margin classes
444
+ .m-#{$key}\@#{$breakpoint} { @include m($value); }
445
+ .mx-#{$key}\@#{$breakpoint} { @include mx($value); }
446
+ .my-#{$key}\@#{$breakpoint} { @include my($value); }
447
+ .mt-#{$key}\@#{$breakpoint} { @include mt($value); }
448
+ .mr-#{$key}\@#{$breakpoint} { @include mr($value); }
449
+ .mb-#{$key}\@#{$breakpoint} { @include mb($value); }
450
+ .ml-#{$key}\@#{$breakpoint} { @include ml($value); }
451
+
452
+ .gap-#{$key}\@#{$breakpoint} { gap: $value; }
453
+ .gap-x-#{$key}\@#{$breakpoint} { column-gap: $value; }
454
+ .gap-y-#{$key}\@#{$breakpoint} { row-gap: $value; }
455
+
456
+ // Space classes
457
+ .space-x-#{$key}\@#{$breakpoint} { @include space-x($value); }
458
+ .space-y-#{$key}\@#{$breakpoint} { @include space-y($value); }
459
+ }
460
+ }
461
+ }
398
462
  }