@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.
@@ -5,100 +5,128 @@
5
5
  @use 'sass:map';
6
6
  @use '../abstracts' as *;
7
7
 
8
+
9
+
10
+ // Common border styles
11
+ $border-styles: (solid, dashed, dotted, double, none);
12
+
8
13
  // -----------------------------------------------
9
14
  // MIXINS
10
15
  // -----------------------------------------------
11
16
 
12
17
  // Core Border Mixins - improved to include style and color by default
13
- @mixin border($val) {
18
+ // SKIP Documentation
19
+ @mixin border($val, $style: solid, $color: var(--border)) {
14
20
  $val: if($val == 0, $val, $val + px);
15
-
16
- border-width: $val;
17
- @if $val != 0 {
18
- border-style: solid; // Apply solid style by default when width > 0
19
- border-color: var(--border, var(--border)); // Apply default color
21
+
22
+ & {
23
+ border-width: $val;
24
+ @if $val != 0 {
25
+ border-style: $style;
26
+ border-color: $color;
27
+ }
20
28
  }
21
29
  }
22
30
 
23
31
  @mixin border-top($val) {
24
32
  $val: if($val == 0, $val, $val + px);
25
-
26
- border-top-width: $val;
27
- @if $val != 0 {
28
- border-top-style: solid;
29
- border-top-color: var(--border, var(--border));
33
+
34
+ & {
35
+ border-top-width: $val;
36
+ @if $val != 0 {
37
+ border-top-style: solid;
38
+ border-top-color: var(--border, var(--border));
39
+ }
30
40
  }
31
41
  }
32
42
 
33
43
  @mixin border-right($val) {
34
44
  $val: if($val == 0, $val, $val + px);
35
-
36
- border-right-width: $val;
37
- @if $val != 0 {
38
- border-right-style: solid;
39
- border-right-color: var(--border, var(--border));
45
+
46
+ & {
47
+ border-right-width: $val;
48
+ @if $val != 0 {
49
+ border-right-style: solid;
50
+ border-right-color: var(--border, var(--border));
51
+ }
40
52
  }
41
53
  }
42
54
 
43
55
  @mixin border-bottom($val) {
44
56
  $val: if($val == 0, $val, $val + px);
45
-
46
- border-bottom-width: $val;
47
- @if $val != 0 {
48
- border-bottom-style: solid;
49
- border-bottom-color: var(--border, var(--border));
57
+
58
+ & {
59
+ border-bottom-width: $val;
60
+ @if $val != 0 {
61
+ border-bottom-style: solid;
62
+ border-bottom-color: var(--border, var(--border));
63
+ }
50
64
  }
51
65
  }
52
66
 
53
67
  @mixin border-left($val) {
54
68
  $val: if($val == 0, $val, $val + px);
55
69
 
56
- border-left-width: $val;
57
- @if $val != 0 {
58
- border-left-style: solid;
59
- border-left-color: var(--border, var(--border));
70
+ & {
71
+ border-left-width: $val;
72
+ @if $val != 0 {
73
+ border-left-style: solid;
74
+ border-left-color: var(--border, var(--border));
75
+ }
60
76
  }
61
77
  }
62
-
78
+
63
79
  // Border Radius Mixins
64
80
  @mixin rounded($val: map.get($border-radii, 'md')) {
65
- border-radius: $val;
81
+ & {border-radius: $val; }
66
82
  }
67
83
 
68
84
  @mixin rounded-t($val) {
69
- border-top-left-radius: $val;
70
- border-top-right-radius: $val;
85
+ & {
86
+ border-top-left-radius: $val;
87
+ border-top-right-radius: $val;
88
+ }
71
89
  }
72
90
 
73
91
  @mixin rounded-r($val) {
74
- border-top-right-radius: $val;
75
- border-bottom-right-radius: $val;
92
+ & {
93
+ border-top-right-radius: $val;
94
+ border-bottom-right-radius: $val;
95
+ }
76
96
  }
77
97
 
78
98
  @mixin rounded-b($val) {
79
- border-bottom-left-radius: $val;
80
- border-bottom-right-radius: $val;
99
+ & {
100
+ border-bottom-left-radius: $val;
101
+ border-bottom-right-radius: $val;
102
+ }
81
103
  }
82
104
 
83
105
  @mixin rounded-l($val) {
84
- border-top-left-radius: $val;
85
- border-bottom-left-radius: $val;
106
+ & {
107
+ border-top-left-radius: $val;
108
+ border-bottom-left-radius: $val;
109
+ }
86
110
  }
87
111
 
88
- @mixin rounded-tl($val) { border-top-left-radius: $val; }
89
- @mixin rounded-tr($val) { border-top-right-radius: $val; }
90
- @mixin rounded-br($val) { border-bottom-right-radius: $val; }
91
- @mixin rounded-bl($val) { border-bottom-left-radius: $val; }
112
+ @mixin rounded-tl($val) { & {border-top-left-radius: $val; }}
113
+ @mixin rounded-tr($val) { & {border-top-right-radius: $val; }}
114
+ @mixin rounded-br($val) { & {border-bottom-right-radius: $val; }}
115
+ @mixin rounded-bl($val) { & {border-bottom-left-radius: $val; }}
92
116
 
93
117
  // Border Style and Color
94
- @mixin border-style($style) { border-style: $style; }
95
- @mixin border-color($color) { border-color: $color; }
118
+ @mixin border-style($style) { & {border-style: $style; }}
119
+ @mixin border-color($color) { & {border-color: $color; }}
96
120
 
97
121
  // Combined border properties
98
122
  @mixin border-all($width, $style, $color) {
99
- border-width: $width;
100
- border-style: $style;
101
- border-color: $color;
123
+ @debug "border: #{$width} #{$style} #{$color}";
124
+
125
+ & {
126
+ border-width: $width;
127
+ border-style: $style;
128
+ border-color: $color;
129
+ }
102
130
  }
103
131
 
104
132
  // -----------------------------------------------
@@ -120,174 +148,172 @@ $border-radii: (
120
148
  'none': 0
121
149
  );
122
150
 
123
- // Common border styles
124
- $border-styles: (solid, dashed, dotted, double, none);
125
-
126
151
  // -----------------------------------------------
127
152
  // UTILITY CLASSES
128
153
  // -----------------------------------------------
154
+ @if $generate-utility-classes {
155
+ // Basic border classes (all sides)
156
+ .border { @include border(1); }
157
+ .border-0 { @include border(0); }
158
+
159
+ // All sides border width
160
+ @each $width in $border-widths {
161
+ .border-#{$width} { @include border($width); }
162
+ }
129
163
 
130
- // Basic border classes (all sides)
131
- .border { @include border(1); }
132
- .border-0 { @include border(0); }
133
-
134
- // All sides border width
135
- @each $width in $border-widths {
136
- .border-#{$width} { @include border($width); }
137
- }
138
-
139
- // Directional border width
140
- @each $width in $border-widths {
141
- .border-t-#{$width} { @include border-top($width); }
142
- .border-r-#{$width} { @include border-right($width); }
143
- .border-b-#{$width} { @include border-bottom($width); }
144
- .border-l-#{$width} { @include border-left($width); }
145
- }
146
-
147
- // Common shortcuts for single-side borders
148
- .border-t { @include border-top(1); }
149
- .border-r { @include border-right(1); }
150
- .border-b { @include border-bottom(1); }
151
- .border-l { @include border-left(1); }
152
-
153
- // Border radius classes
154
- .rounded { @include rounded; } // Default rounded
155
- .square { @include rounded(0); } // Alias for no radius
164
+ // Directional border width
165
+ @each $width in $border-widths {
166
+ .border-t-#{$width} { @include border-top($width); }
167
+ .border-r-#{$width} { @include border-right($width); }
168
+ .border-b-#{$width} { @include border-bottom($width); }
169
+ .border-l-#{$width} { @include border-left($width); }
170
+ }
156
171
 
157
- @each $name, $value in $border-radii {
158
- .rounded-#{$name} { @include rounded($value); }
159
- }
172
+ // Common shortcuts for single-side borders
173
+ .border-t { @include border-top(1); }
174
+ .border-r { @include border-right(1); }
175
+ .border-b { @include border-bottom(1); }
176
+ .border-l { @include border-left(1); }
160
177
 
161
- // Directional border radius
162
- @each $name, $value in $border-radii {
163
- .rounded-t-#{$name} { @include rounded-t($value); }
164
- .rounded-r-#{$name} { @include rounded-r($value); }
165
- .rounded-b-#{$name} { @include rounded-b($value); }
166
- .rounded-l-#{$name} { @include rounded-l($value); }
167
-
168
- // Individual corners
169
- .rounded-tl-#{$name} { @include rounded-tl($value); }
170
- .rounded-tr-#{$name} { @include rounded-tr($value); }
171
- .rounded-br-#{$name} { @include rounded-br($value); }
172
- .rounded-bl-#{$name} { @include rounded-bl($value); }
173
- }
178
+ // Border radius classes
179
+ .rounded { @include rounded; } // Default rounded
180
+ .square { @include rounded(0); } // Alias for no radius
174
181
 
175
- // Pill shape (alias for full radius)
176
- .pill { @include rounded(9999px); }
182
+ @each $name, $value in $border-radii {
183
+ .rounded-#{$name} { @include rounded($value); }
184
+ }
177
185
 
178
- // Border styles - these override the default solid style if needed
179
- @each $style in $border-styles {
180
- .border-#{$style} { @include border-style($style); }
181
- }
186
+ // Directional border radius
187
+ @each $name, $value in $border-radii {
188
+ .rounded-t-#{$name} { @include rounded-t($value); }
189
+ .rounded-r-#{$name} { @include rounded-r($value); }
190
+ .rounded-b-#{$name} { @include rounded-b($value); }
191
+ .rounded-l-#{$name} { @include rounded-l($value); }
192
+
193
+ // Individual corners
194
+ .rounded-tl-#{$name} { @include rounded-tl($value); }
195
+ .rounded-tr-#{$name} { @include rounded-tr($value); }
196
+ .rounded-br-#{$name} { @include rounded-br($value); }
197
+ .rounded-bl-#{$name} { @include rounded-bl($value); }
198
+ }
182
199
 
183
- // Border colors - these override the default color if needed
184
- .border-default { @include border-color(var(--border)); }
185
- .border-light { @include border-color(var(--border-light-color)); }
186
- .border-dark { @include border-color(var(--border-dark-color)); }
187
- .border-primary { @include border-color(var(--primary)); }
188
- .border-secondary { @include border-color(var(--secondary)); }
189
- .border-success { @include border-color(var(--success)); }
190
- .border-danger { @include border-color(var(--danger)); }
191
- .border-warning { @include border-color(var(--warning)); }
192
- .border-info { @include border-color(var(--info)); }
193
-
194
- // Common combined border utilities (style + color)
195
- .border-primary-solid {
196
- @include border-style(solid);
197
- @include border-color(var(--primary));
198
- }
200
+ // Pill shape (alias for full radius)
201
+ .pill { @include rounded(9999px); }
199
202
 
200
- .border-danger-dashed {
201
- @include border-style(dashed);
202
- @include border-color(var(--danger));
203
- }
203
+ // Border styles - these override the default solid style if needed
204
+ @each $style in $border-styles {
205
+ .border-#{$style} { @include border-style($style); }
206
+ }
204
207
 
205
- // -----------------------------------------------
206
- // HOVER, ACTIVE, AND FOCUS STATES
207
- // -----------------------------------------------
208
+ // Border colors - these override the default color if needed
209
+ .border-default { @include border-color(var(--border)); }
210
+ .border-light { @include border-color(var(--border-light-color)); }
211
+ .border-dark { @include border-color(var(--border-dark-color)); }
212
+ .border-primary { @include border-color(var(--primary)); }
213
+ .border-secondary { @include border-color(var(--secondary)); }
214
+ .border-success { @include border-color(var(--success)); }
215
+ .border-danger { @include border-color(var(--danger)); }
216
+ .border-warning { @include border-color(var(--warning)); }
217
+ .border-info { @include border-color(var(--info)); }
218
+
219
+ // Common combined border utilities (style + color)
220
+ .border-primary-solid {
221
+ @include border-style(solid);
222
+ @include border-color(var(--primary));
223
+ }
208
224
 
209
- // Hover state border classes
210
- @each $width in $border-widths {
211
- .hover\:border-#{$width}:hover { @include border($width); }
212
- }
225
+ .border-danger-dashed {
226
+ @include border-style(dashed);
227
+ @include border-color(var(--danger));
228
+ }
213
229
 
214
- @each $style in $border-styles {
215
- .hover\:border-#{$style}:hover { @include border-style($style); }
216
- }
230
+ // -----------------------------------------------
231
+ // HOVER, ACTIVE, AND FOCUS STATES
232
+ // -----------------------------------------------
217
233
 
218
- // Border colors on hover
219
- .hover\:border-default:hover { @include border-color(var(--border)); }
220
- .hover\:border-light:hover { @include border-color(var(--border-light-color)); }
221
- .hover\:border-dark:hover { @include border-color(var(--border-dark-color)); }
222
- .hover\:border-primary:hover { @include border-color(var(--primary)); }
223
- .hover\:border-secondary:hover { @include border-color(var(--secondary)); }
224
- .hover\:border-success:hover { @include border-color(var(--success)); }
225
- .hover\:border-danger:hover { @include border-color(var(--danger)); }
226
- .hover\:border-warning:hover { @include border-color(var(--warning)); }
227
- .hover\:border-info:hover { @include border-color(var(--info)); }
228
-
229
- // Active state border classes
230
- @each $width in $border-widths {
231
- .active\:border-#{$width}:active { @include border($width); }
232
- }
234
+ // Hover state border classes
235
+ @each $width in $border-widths {
236
+ .hover\:border-#{$width}:hover { @include border($width); }
237
+ }
233
238
 
234
- @each $style in $border-styles {
235
- .active\:border-#{$style}:active { @include border-style($style); }
236
- }
239
+ @each $style in $border-styles {
240
+ .hover\:border-#{$style}:hover { @include border-style($style); }
241
+ }
237
242
 
238
- // Border colors on active state
239
- .active\:border-default:active { @include border-color(var(--border)); }
240
- .active\:border-light:active { @include border-color(var(--border-light-color)); }
241
- .active\:border-dark:active { @include border-color(var(--border-dark-color)); }
242
- .active\:border-primary:active { @include border-color(var(--primary)); }
243
- .active\:border-secondary:active { @include border-color(var(--secondary)); }
244
- .active\:border-success:active { @include border-color(var(--success)); }
245
- .active\:border-danger:active { @include border-color(var(--danger)); }
246
- .active\:border-warning:active { @include border-color(var(--warning)); }
247
- .active\:border-info:active { @include border-color(var(--info)); }
248
-
249
- // Focus state border classes
250
- @each $width in $border-widths {
251
- .focus\:border-#{$width}:focus { @include border($width); }
252
- }
243
+ // Border colors on hover
244
+ .hover\:border-default:hover { @include border-color(var(--border)); }
245
+ .hover\:border-light:hover { @include border-color(var(--border-light-color)); }
246
+ .hover\:border-dark:hover { @include border-color(var(--border-dark-color)); }
247
+ .hover\:border-primary:hover { @include border-color(var(--primary)); }
248
+ .hover\:border-secondary:hover { @include border-color(var(--secondary)); }
249
+ .hover\:border-success:hover { @include border-color(var(--success)); }
250
+ .hover\:border-danger:hover { @include border-color(var(--danger)); }
251
+ .hover\:border-warning:hover { @include border-color(var(--warning)); }
252
+ .hover\:border-info:hover { @include border-color(var(--info)); }
253
+
254
+ // Active state border classes
255
+ @each $width in $border-widths {
256
+ .active\:border-#{$width}:active { @include border($width); }
257
+ }
253
258
 
254
- @each $style in $border-styles {
255
- .focus\:border-#{$style}:focus { @include border-style($style); }
256
- }
259
+ @each $style in $border-styles {
260
+ .active\:border-#{$style}:active { @include border-style($style); }
261
+ }
257
262
 
258
- // Border colors on focus
259
- .focus\:border-default:focus { @include border-color(var(--border)); }
260
- .focus\:border-light:focus { @include border-color(var(--border-light-color)); }
261
- .focus\:border-dark:focus { @include border-color(var(--border-dark-color)); }
262
- .focus\:border-primary:focus { @include border-color(var(--primary)); }
263
- .focus\:border-secondary:focus { @include border-color(var(--secondary)); }
264
- .focus\:border-success:focus { @include border-color(var(--success)); }
265
- .focus\:border-danger:focus { @include border-color(var(--danger)); }
266
- .focus\:border-warning:focus { @include border-color(var(--warning)); }
267
- .focus\:border-info:focus { @include border-color(var(--info)); }
263
+ // Border colors on active state
264
+ .active\:border-default:active { @include border-color(var(--border)); }
265
+ .active\:border-light:active { @include border-color(var(--border-light-color)); }
266
+ .active\:border-dark:active { @include border-color(var(--border-dark-color)); }
267
+ .active\:border-primary:active { @include border-color(var(--primary)); }
268
+ .active\:border-secondary:active { @include border-color(var(--secondary)); }
269
+ .active\:border-success:active { @include border-color(var(--success)); }
270
+ .active\:border-danger:active { @include border-color(var(--danger)); }
271
+ .active\:border-warning:active { @include border-color(var(--warning)); }
272
+ .active\:border-info:active { @include border-color(var(--info)); }
273
+
274
+ // Focus state border classes
275
+ @each $width in $border-widths {
276
+ .focus\:border-#{$width}:focus { @include border($width); }
277
+ }
268
278
 
269
- // -----------------------------------------------
270
- // RESPONSIVE CLASSES
271
- // -----------------------------------------------
279
+ @each $style in $border-styles {
280
+ .focus\:border-#{$style}:focus { @include border-style($style); }
281
+ }
272
282
 
273
- @each $breakpoint, $width in $breakpoints {
274
- @media (min-width: #{$width}) {
275
- // Border width responsive
276
- @each $val in $border-widths {
277
- .border-#{$val}\@#{$breakpoint} { @include border($val); }
283
+ // Border colors on focus
284
+ .focus\:border-default:focus { @include border-color(var(--border)); }
285
+ .focus\:border-light:focus { @include border-color(var(--border-light-color)); }
286
+ .focus\:border-dark:focus { @include border-color(var(--border-dark-color)); }
287
+ .focus\:border-primary:focus { @include border-color(var(--primary)); }
288
+ .focus\:border-secondary:focus { @include border-color(var(--secondary)); }
289
+ .focus\:border-success:focus { @include border-color(var(--success)); }
290
+ .focus\:border-danger:focus { @include border-color(var(--danger)); }
291
+ .focus\:border-warning:focus { @include border-color(var(--warning)); }
292
+ .focus\:border-info:focus { @include border-color(var(--info)); }
293
+
294
+ // -----------------------------------------------
295
+ // RESPONSIVE CLASSES
296
+ // -----------------------------------------------
297
+
298
+ @each $breakpoint, $width in $breakpoints {
299
+ @media (min-width: #{$width}) {
300
+ // Border width responsive
301
+ @each $val in $border-widths {
302
+ .border-#{$val}\@#{$breakpoint} { @include border($val); }
303
+ }
304
+
305
+ // Common shortcuts for responsive
306
+ .border\@#{$breakpoint} { @include border(1); }
307
+ .border-0\@#{$breakpoint} { @include border(0); }
308
+
309
+ // Border radius responsive
310
+ @each $name, $value in $border-radii {
311
+ .rounded-#{$name}\@#{$breakpoint} { @include rounded($value); }
312
+ }
313
+
314
+ .rounded\@#{$breakpoint} { @include rounded; }
315
+ .square\@#{$breakpoint} { @include rounded(0); }
316
+ .pill\@#{$breakpoint} { @include rounded(9999px); }
278
317
  }
279
-
280
- // Common shortcuts for responsive
281
- .border\@#{$breakpoint} { @include border(1); }
282
- .border-0\@#{$breakpoint} { @include border(0); }
283
-
284
- // Border radius responsive
285
- @each $name, $value in $border-radii {
286
- .rounded-#{$name}\@#{$breakpoint} { @include rounded($value); }
287
- }
288
-
289
- .rounded\@#{$breakpoint} { @include rounded; }
290
- .square\@#{$breakpoint} { @include rounded(0); }
291
- .pill\@#{$breakpoint} { @include rounded(9999px); }
292
318
  }
293
- }
319
+ }
@@ -110,14 +110,14 @@ $colors-primitives: ();
110
110
  }
111
111
  }
112
112
  @mixin gradient($direction, $colors...) {
113
- background-image: linear-gradient($direction, $colors);
113
+ & { background-image: linear-gradient($direction, $colors); }
114
114
  }
115
115
 
116
116
  // Filter Mixins
117
117
  @mixin backdrop-filter($value) {
118
- backdrop-filter: $value;
118
+ & { backdrop-filter: $value; }
119
119
  }
120
120
 
121
121
  @mixin filter($value) {
122
- filter: $value;
122
+ & { filter: $value; }
123
123
  }
@@ -81,17 +81,19 @@
81
81
  container-name: $name;
82
82
  }
83
83
 
84
- // Utility classes
85
- .container-inline-size {
86
- container-type: inline-size;
87
- }
84
+ @if $generate-utility-classes {
85
+ // Utility classes
86
+ .container-inline-size {
87
+ container-type: inline-size;
88
+ }
88
89
 
89
- .container-size {
90
- container-type: size;
91
- }
90
+ .container-size {
91
+ container-type: size;
92
+ }
92
93
 
93
- @each $name in ("main", "sidebar", "card", "section") {
94
- .container-#{$name} {
95
- container-name: $name;
94
+ @each $name in ("main", "sidebar", "card", "section") {
95
+ .container-#{$name} {
96
+ container-name: $name;
97
+ }
96
98
  }
97
- }
99
+ }