@nuvoui/core 1.2.2 → 1.2.3

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.
@@ -117,7 +117,7 @@
117
117
  * @description Sets padding on all sides
118
118
  * @param {Number|String} $val - Padding value
119
119
  */
120
- @mixin p($val) { & { padding: format-unit-value($val); }}
120
+ @mixin p($val) { padding: format-unit-value($val); }
121
121
 
122
122
  /**
123
123
  * @mixin px
@@ -126,11 +126,9 @@
126
126
  */
127
127
  @mixin px($val) {
128
128
  $val: format-unit-value($val);
129
-
130
- & {
131
- padding-left: $val;
132
- padding-right: $val;
133
- }
129
+
130
+ padding-left: $val;
131
+ padding-right: $val;
134
132
  }
135
133
 
136
134
  /**
@@ -141,10 +139,8 @@
141
139
  @mixin py($val) {
142
140
  $val: format-unit-value($val);
143
141
 
144
- & {
145
- padding-top: $val;
146
- padding-bottom: $val;
147
- }
142
+ padding-top: $val;
143
+ padding-bottom: $val;
148
144
  }
149
145
 
150
146
  /**
@@ -153,11 +149,9 @@
153
149
  * @param {Number|String} $val - Padding value
154
150
  */
155
151
  @mixin pt($val) {
156
- & {
157
- $val: format-unit-value($val);
158
-
159
- padding-top: $val;
160
- }
152
+ $val: format-unit-value($val);
153
+
154
+ padding-top: $val;
161
155
  }
162
156
 
163
157
  /**
@@ -166,11 +160,9 @@
166
160
  * @param {Number|String} $val - Padding value
167
161
  */
168
162
  @mixin pr($val) {
169
- & {
170
- $val: format-unit-value($val);
171
-
172
- padding-right: $val;
173
- }
163
+ $val: format-unit-value($val);
164
+
165
+ padding-right: $val;
174
166
  }
175
167
 
176
168
  /**
@@ -179,11 +171,9 @@
179
171
  * @param {Number|String} $val - Padding value
180
172
  */
181
173
  @mixin pb($val) {
182
- & {
183
- $val: format-unit-value($val);
184
-
185
- padding-bottom: $val;
186
- }
174
+ $val: format-unit-value($val);
175
+
176
+ padding-bottom: $val;
187
177
  }
188
178
 
189
179
  /**
@@ -192,11 +182,9 @@
192
182
  * @param {Number|String} $val - Padding value
193
183
  */
194
184
  @mixin pl($val) {
195
- & {
196
- $val: format-unit-value($val);
197
-
198
- padding-left: $val;
199
- }
185
+ $val: format-unit-value($val);
186
+
187
+ padding-left: $val;
200
188
  }
201
189
 
202
190
  // -----------------------------------------------
@@ -209,11 +197,9 @@
209
197
  * @param {Number|String} $val - Margin value
210
198
  */
211
199
  @mixin m($val) {
212
- & {
213
- $val: format-unit-value($val);
214
-
215
- margin: $val;
216
- }
200
+ $val: format-unit-value($val);
201
+
202
+ margin: $val;
217
203
  }
218
204
 
219
205
  /**
@@ -224,10 +210,8 @@
224
210
  @mixin mx($val) {
225
211
  $val: format-unit-value($val);
226
212
 
227
- & {
228
- margin-left: $val;
229
- margin-right: $val;
230
- }
213
+ margin-left: $val;
214
+ margin-right: $val;
231
215
  }
232
216
 
233
217
  /**
@@ -238,10 +222,8 @@
238
222
  @mixin my($val) {
239
223
  $val: format-unit-value($val);
240
224
 
241
- &{
242
- margin-top: $val;
243
- margin-bottom: $val;
244
- }
225
+ margin-top: $val;
226
+ margin-bottom: $val;
245
227
  }
246
228
 
247
229
  /**
@@ -250,11 +232,9 @@
250
232
  * @param {Number|String} $val - Margin value
251
233
  */
252
234
  @mixin mt($val) {
253
- & {
254
- $val: format-unit-value($val);
255
-
256
- margin-top: $val;
257
- }
235
+ $val: format-unit-value($val);
236
+
237
+ margin-top: $val;
258
238
  }
259
239
 
260
240
  /**
@@ -263,11 +243,9 @@
263
243
  * @param {Number|String} $val - Margin value
264
244
  */
265
245
  @mixin mr($val) {
266
- & {
267
- $val: format-unit-value($val);
268
-
269
- margin-right: $val;
270
- }
246
+ $val: format-unit-value($val);
247
+
248
+ margin-right: $val;
271
249
  }
272
250
 
273
251
  /**
@@ -276,11 +254,9 @@
276
254
  * @param {Number|String} $val - Margin value
277
255
  */
278
256
  @mixin mb($val) {
279
- & {
280
- $val: format-unit-value($val);
281
-
282
- margin-bottom: $val;
283
- }
257
+ $val: format-unit-value($val);
258
+
259
+ margin-bottom: $val;
284
260
  }
285
261
 
286
262
  /**
@@ -289,24 +265,22 @@
289
265
  * @param {Number|String} $val - Margin value
290
266
  */
291
267
  @mixin ml($val) {
292
- & {
293
- $val: format-unit-value($val);
294
-
295
- margin-left: $val;
296
- }
268
+ $val: format-unit-value($val);
269
+
270
+ margin-left: $val;
297
271
  }
298
272
 
299
273
  /**
300
274
  * @mixin ml-auto
301
275
  * @description Sets margin-left to auto
302
276
  */
303
- @mixin ml-auto { & { margin-left: auto; } }
277
+ @mixin ml-auto { margin-left: auto; }
304
278
 
305
279
  /**
306
280
  * @mixin mr-auto
307
281
  * @description Sets margin-right to auto
308
282
  */
309
- @mixin mr-auto { & { margin-right: auto; } }
283
+ @mixin mr-auto { margin-right: auto; }
310
284
 
311
285
  /**
312
286
  * @mixin mx-auto
@@ -424,39 +398,39 @@
424
398
  // -----------------------------------------------
425
399
 
426
400
  @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
- }
401
+ @media (min-width: #{$width}) {
402
+ .mx-auto\@#{$breakpoint} { @include mx-auto; }
403
+ .ml-auto\@#{$breakpoint} { @include ml-auto; }
404
+ .mr-auto\@#{$breakpoint} { @include mr-auto; }
405
+
406
+ // Generate utilities from spacing map
407
+ @each $key, $value in $spacings {
408
+ // Padding classes
409
+ .p-#{$key}\@#{$breakpoint} { @include p($value); }
410
+ .px-#{$key}\@#{$breakpoint} { @include px($value); }
411
+ .py-#{$key}\@#{$breakpoint} { @include py($value); }
412
+ .pt-#{$key}\@#{$breakpoint} { @include pt($value); }
413
+ .pr-#{$key}\@#{$breakpoint} { @include pr($value); }
414
+ .pb-#{$key}\@#{$breakpoint} { @include pb($value); }
415
+ .pl-#{$key}\@#{$breakpoint} { @include pl($value); }
416
+
417
+ // Margin classes
418
+ .m-#{$key}\@#{$breakpoint} { @include m($value); }
419
+ .mx-#{$key}\@#{$breakpoint} { @include mx($value); }
420
+ .my-#{$key}\@#{$breakpoint} { @include my($value); }
421
+ .mt-#{$key}\@#{$breakpoint} { @include mt($value); }
422
+ .mr-#{$key}\@#{$breakpoint} { @include mr($value); }
423
+ .mb-#{$key}\@#{$breakpoint} { @include mb($value); }
424
+ .ml-#{$key}\@#{$breakpoint} { @include ml($value); }
425
+
426
+ .gap-#{$key}\@#{$breakpoint} { gap: $value; }
427
+ .gap-x-#{$key}\@#{$breakpoint} { column-gap: $value; }
428
+ .gap-y-#{$key}\@#{$breakpoint} { row-gap: $value; }
429
+
430
+ // Space classes
431
+ .space-x-#{$key}\@#{$breakpoint} { @include space-x($value); }
432
+ .space-y-#{$key}\@#{$breakpoint} { @include space-y($value); }
460
433
  }
434
+ }
461
435
  }
462
- }
436
+ }
@@ -13,11 +13,9 @@
13
13
 
14
14
  // Base transition mixins
15
15
  @mixin transition {
16
- & {
17
- transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
18
- transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
19
- transition-duration: 150ms;
20
- }
16
+ transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
17
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
18
+ transition-duration: 150ms;
21
19
  }
22
20
 
23
21
  // Property-specific transition mixins
@@ -155,4 +153,4 @@ $delays: (
155
153
  }
156
154
  }
157
155
  }
158
- }
156
+ }
@@ -32,135 +32,131 @@
32
32
  * @param {string} $size - The size of the text.
33
33
  */
34
34
  @mixin text-size($size) {
35
- & {
36
35
  @if map.has-key(VAR.$font-sizes, $size) {
37
36
  font-size: map.get(VAR.$font-sizes, $size);
38
37
  } @else {
39
38
  font-size: $size;
40
39
  }
41
- }
42
40
  }
43
41
 
44
42
  // Font weights
45
- @mixin font-thin { & { font-weight: 100; } }
46
- @mixin font-extralight { & { font-weight: 200; } }
47
- @mixin font-light { & { font-weight: 300; } }
48
- @mixin font-normal { & { font-weight: 400; } }
49
- @mixin font-medium { & { font-weight: 500; } }
50
- @mixin font-semibold { & { font-weight: 600; } }
51
- @mixin font-bold { & { font-weight: 700; } }
52
- @mixin font-extrabold { & { font-weight: 800; } }
53
- @mixin font-black { & { font-weight: 900; } }
43
+ @mixin font-thin { font-weight: 100; }
44
+ @mixin font-extralight { font-weight: 200; }
45
+ @mixin font-light { font-weight: 300; }
46
+ @mixin font-normal { font-weight: 400; }
47
+ @mixin font-medium { font-weight: 500; }
48
+ @mixin font-semibold { font-weight: 600; }
49
+ @mixin font-bold { font-weight: 700; }
50
+ @mixin font-extrabold { font-weight: 800; }
51
+ @mixin font-black { font-weight: 900; }
54
52
 
55
53
 
56
54
  @mixin leading($value){
57
- & {
58
- @if meta.type-of($value) == 'number' {
59
- line-height: $value;
60
- } @else if $value == 'none' {
61
- line-height: 1;
62
- } @else if $value == 'tight' {
63
- line-height: 1.25;
64
- } @else if $value == 'snug' {
65
- line-height: 1.375;
66
- } @else if $value == 'normal' {
67
- line-height: 1.5;
68
- } @else if $value == 'relaxed' {
69
- line-height: 1.625;
70
- } @else if $value == 'loose' {
71
- line-height: 2;
72
- } @else {
73
- line-height: $value;
74
- }
55
+ @if meta.type-of($value) == 'number' {
56
+ line-height: $value;
57
+ } @else if $value == 'none' {
58
+ line-height: 1;
59
+ } @else if $value == 'tight' {
60
+ line-height: 1.25;
61
+ } @else if $value == 'snug' {
62
+ line-height: 1.375;
63
+ } @else if $value == 'normal' {
64
+ line-height: 1.5;
65
+ } @else if $value == 'relaxed' {
66
+ line-height: 1.625;
67
+ } @else if $value == 'loose' {
68
+ line-height: 2;
69
+ } @else {
70
+ line-height: $value;
75
71
  }
76
72
  }
77
73
 
78
74
  // Line heights
79
- @mixin leading-none { & { @include leading(none);} }
80
- @mixin leading-tight { & { @include leading(tight);} }
81
- @mixin leading-snug { & { @include leading(snug);} }
82
- @mixin leading-normal { & { @include leading(normal);} }
83
- @mixin leading-relaxed { & { @include leading(relaxed);} }
84
- @mixin leading-loose { & { @include leading(loose);} }
75
+ @mixin leading-none { @include leading(none);}
76
+ @mixin leading-tight { @include leading(tight);}
77
+ @mixin leading-snug { @include leading(snug);}
78
+ @mixin leading-normal { @include leading(normal);}
79
+ @mixin leading-relaxed { @include leading(relaxed);}
80
+ @mixin leading-loose { @include leading(loose);}
85
81
 
86
82
  // Text alignment
87
- @mixin text-left { & { text-align: left; } }
88
- @mixin text-center { & { text-align: center; } }
89
- @mixin text-right { & { text-align: right; } }
90
- @mixin text-justify { & { text-align: justify; } }
83
+ @mixin text-left { text-align: left; }
84
+ @mixin text-center { text-align: center; }
85
+ @mixin text-right { text-align: right; }
86
+ @mixin text-justify { text-align: justify; }
91
87
 
92
88
 
93
89
  // Text transform mixins
94
- @mixin uppercase { & { text-transform: uppercase; } }
95
- @mixin lowercase { & { text-transform: lowercase; } }
96
- @mixin capitalize { & { text-transform: capitalize; } }
97
- @mixin normal-case { & { text-transform: none; } }
90
+ @mixin uppercase { text-transform: uppercase; }
91
+ @mixin lowercase { text-transform: lowercase; }
92
+ @mixin capitalize { text-transform: capitalize; }
93
+ @mixin normal-case { text-transform: none; }
98
94
 
99
95
  // Font style mixins
100
- @mixin italic { & { font-style: italic; } }
101
- @mixin not-italic { & { font-style: normal; } }
96
+ @mixin italic { font-style: italic; }
97
+ @mixin not-italic { font-style: normal; }
102
98
 
103
99
  // Text decoration mixins
104
- @mixin underline { & { text-decoration: underline; } }
105
- @mixin line-through { & { text-decoration: line-through; } }
106
- @mixin no-underline { & { text-decoration: none; } }
100
+ @mixin underline { text-decoration: underline; }
101
+ @mixin line-through { text-decoration: line-through; }
102
+ @mixin no-underline { text-decoration: none; }
107
103
 
108
104
  // Text overflow mixin
109
105
  @mixin truncate {
110
- & {
111
- overflow: hidden;
112
- text-overflow: ellipsis;
113
- white-space: nowrap;
114
- }
106
+ overflow: hidden;
107
+ text-overflow: ellipsis;
108
+ white-space: nowrap;
109
+ }
110
+
111
+ @mixin overflow-label {
112
+ white-space: nowrap;
113
+ word-break: break-all;
114
+ text-overflow: ellipsis;
115
+ overflow: hidden;
116
+ min-width: 0;
115
117
  }
116
118
 
117
119
  @mixin truncate-lines($lines: 2) {
118
- & {
119
- display: -webkit-box;
120
- -webkit-line-clamp: $lines;
121
- -webkit-box-orient: vertical;
122
- overflow: hidden;
123
- text-overflow: ellipsis;
124
- }
120
+ display: -webkit-box;
121
+ -webkit-line-clamp: $lines;
122
+ -webkit-box-orient: vertical;
123
+ overflow: hidden;
124
+ text-overflow: ellipsis;
125
125
  }
126
126
 
127
127
 
128
128
  @mixin break-normal {
129
- & {
130
- overflow-wrap: normal;
131
- word-break: normal;
132
- }
129
+ overflow-wrap: normal;
130
+ word-break: normal;
133
131
  }
134
132
 
135
- @mixin break-words { & {overflow-wrap: break-word; }}
136
- @mixin break-all { & {word-break: break-all; }}
137
- @mixin whitespace-normal { & {white-space: normal; }}
138
- @mixin whitespace-nowrap { & {white-space: nowrap; }}
139
- @mixin whitespace-pre { & {white-space: pre; }}
140
- @mixin whitespace-pre-line { & {white-space: pre-line; }}
141
- @mixin whitespace-pre-wrap { & {white-space: pre-wrap; }}
133
+ @mixin break-words { overflow-wrap: break-word; }
134
+ @mixin break-all { word-break: break-all; }
135
+ @mixin whitespace-normal { white-space: normal; }
136
+ @mixin whitespace-nowrap { white-space: nowrap; }
137
+ @mixin whitespace-pre { white-space: pre; }
138
+ @mixin whitespace-pre-line { white-space: pre-line; }
139
+ @mixin whitespace-pre-wrap { white-space: pre-wrap; }
142
140
 
143
141
 
144
142
  // Custom letter spacing mixin with value
145
143
  @mixin tracking($value) {
146
- & {
147
- @if meta.type-of($value) == 'number' {
148
- letter-spacing: $value;
149
- } @else if $value == 'tighter' {
150
- letter-spacing: -0.05em;
151
- } @else if $value == 'tight' {
152
- letter-spacing: -0.025em;
153
- } @else if $value == 'normal' {
154
- letter-spacing: 0;
155
- } @else if $value == 'wide' {
156
- letter-spacing: 0.025em;
157
- } @else if $value == 'wider' {
158
- letter-spacing: 0.05em;
159
- } @else if $value == 'widest' {
160
- letter-spacing: 0.1em;
161
- } @else {
162
- letter-spacing: $value;
163
- }
144
+ @if meta.type-of($value) == 'number' {
145
+ letter-spacing: $value;
146
+ } @else if $value == 'tighter' {
147
+ letter-spacing: -0.05em;
148
+ } @else if $value == 'tight' {
149
+ letter-spacing: -0.025em;
150
+ } @else if $value == 'normal' {
151
+ letter-spacing: 0;
152
+ } @else if $value == 'wide' {
153
+ letter-spacing: 0.025em;
154
+ } @else if $value == 'wider' {
155
+ letter-spacing: 0.05em;
156
+ } @else if $value == 'widest' {
157
+ letter-spacing: 0.1em;
158
+ } @else {
159
+ letter-spacing: $value;
164
160
  }
165
161
  }
166
162
 
@@ -230,6 +226,8 @@
230
226
  .tracking-wide#{$suffix} { @include tracking(wide) };
231
227
  .tracking-wider#{$suffix} { @include tracking(wider) };
232
228
  .tracking-widest#{$suffix} { @include tracking(widest) };
229
+
230
+ .overflow-label#{$suffix}{@include overflow-label};
233
231
  }
234
232
 
235
233
  @if VAR.$generate-utility-classes {
@@ -244,12 +242,11 @@
244
242
  .whitespace-pre-wrap { @include whitespace-pre-wrap; }
245
243
 
246
244
  @each $breakpoint, $width in VAR.$breakpoints {
247
- @media (min-width: #{$width}) {
248
- @each $size, $val in VAR.$font-sizes {
249
- .text-#{$size}\@#{$breakpoint} { @include text-size($size); }
250
- }
251
- @include responsive-typography($breakpoint);
245
+ @media (min-width: #{$width}) {
246
+ @each $size, $val in VAR.$font-sizes {
247
+ .text-#{$size}\@#{$breakpoint} { @include text-size($size); }
252
248
  }
249
+ @include responsive-typography($breakpoint);
250
+ }
253
251
  }
254
-
255
252
  }