@nuvoui/core 1.1.5 → 1.1.6

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuvoui/core",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
4
4
  "description": "NuvoUI is a human-friendly SCSS framework designed for simplicity, and modern responsive designs.",
5
5
  "main": "dist/nuvoui.css",
6
6
  "module": "src/styles/index.scss",
@@ -51,6 +51,7 @@
51
51
  "access": "public"
52
52
  },
53
53
  "devDependencies": {
54
+ "chokidar": "^4.0.3",
54
55
  "cssnano": "^7.0.6",
55
56
  "glob": "^11.0.0",
56
57
  "postcss": "^8.4.49",
@@ -5,11 +5,15 @@
5
5
  @forward 'base/reset';
6
6
  @forward 'base/base';
7
7
 
8
+ // Layouts
9
+ @forward 'layouts/container';
10
+ @forward 'layouts/flex';
11
+ @forward 'layouts/grid';
12
+
8
13
  // Utilities
9
14
  @forward 'utilities/animations';
10
15
  @forward 'utilities/borders';
11
16
  @forward 'utilities/colors';
12
- @forward 'utilities/display';
13
17
  @forward 'utilities/opacity';
14
18
  @forward 'utilities/position';
15
19
  @forward 'utilities/media-queries';
@@ -18,11 +22,10 @@
18
22
  @forward 'utilities/spacing';
19
23
  @forward 'utilities/typography';
20
24
  @forward 'utilities/tooltips';
25
+ @forward 'utilities/display';
26
+
27
+ @forward 'utilities/helpers';
21
28
 
22
- // Layouts
23
- @forward 'layouts/container';
24
- @forward 'layouts/flex';
25
- @forward 'layouts/grid';
26
29
 
27
30
  // Theme
28
31
  @forward 'themes/theme';
@@ -1,63 +1,258 @@
1
+ // Section: Layout
2
+ // Module: Flex | Flex Inline
3
+
1
4
  @use 'sass:math';
5
+ @use '../utilities/media-queries' as MC;
2
6
  @use '../utilities/variables' as *;
3
- @use '../utilities/functions' as *;
7
+ @use '../utilities/functions' as FN;
4
8
 
5
- // Flex Container Mixins
9
+ /**
10
+ * @description Establishes a flex container.
11
+ */
6
12
  @mixin flex {display: flex;}
13
+
14
+ /**
15
+ * @description Establishes a flex-inline container.
16
+ */
7
17
  @mixin flex-inline {display: inline-flex;}
8
18
 
9
- // Direction Mixins
19
+ /**
20
+ * @description Sets flex-direction to row.
21
+ * @dependencies flex | flex-inline
22
+ */
10
23
  @mixin row {flex-direction: row;}
24
+
25
+ /**
26
+ * @description Sets flex-direction to row-reverse.
27
+ * @dependencies flex | flex-inline
28
+ */
11
29
  @mixin row-reverse {flex-direction: row-reverse;}
30
+
31
+ /**
32
+ * @description Sets flex-direction to column.
33
+ * @dependencies flex | flex-inline
34
+ */
12
35
  @mixin col {flex-direction: column;}
36
+
37
+ /**
38
+ * @description Sets flex-direction to column-reverse.
39
+ * @dependencies flex | flex-inline
40
+ */
13
41
  @mixin col-reverse {flex-direction: column-reverse;}
14
42
 
15
- // Wrap Mixins
43
+ /**
44
+ * @description Sets flex-wrap to wrap.
45
+ * @dependencies flex | flex-inline
46
+ */
16
47
  @mixin wrap {flex-wrap: wrap;}
48
+
49
+ /**
50
+ * @description Sets flex-wrap to nowrap.
51
+ * @dependencies flex | flex-inline
52
+ */
17
53
  @mixin nowrap {flex-wrap: nowrap;}
54
+
55
+ /**
56
+ * @description Sets flex-wrap to wrap-reverse
57
+ * @dependencies flex | flex-inline
58
+ */
18
59
  @mixin wrap-reverse {flex-wrap: wrap-reverse;}
19
60
 
20
- // Main Axis Alignment Mixins
61
+ /**
62
+ * @description Sets justify-content to flex-start
63
+ * @dependencies flex | flex-inline
64
+ */
21
65
  @mixin start {justify-content: flex-start;}
66
+
67
+ /**
68
+ * @description Sets justify-content to flex-end
69
+ * @dependencies flex | flex-inline
70
+ */
22
71
  @mixin end {justify-content: flex-end;}
72
+
73
+ /**
74
+ * @description Sets justify-content to center
75
+ * @dependencies flex | flex-inline
76
+ */
23
77
  @mixin center {justify-content: center;}
78
+
79
+ /**
80
+ * @description Sets justify-content to space-between
81
+ * @dependencies flex | flex-inline
82
+ */
24
83
  @mixin between {justify-content: space-between;}
84
+
85
+ /**
86
+ * @description Sets justify-content to space-around
87
+ * @dependencies flex | flex-inline
88
+ */
25
89
  @mixin around {justify-content: space-around;}
90
+
91
+ /**
92
+ * @description Sets justify-content to space-evenly
93
+ * @dependencies flex | flex-inline
94
+ */
26
95
  @mixin evenly {justify-content: space-evenly;}
27
96
 
28
97
  // Cross Axis Alignment Mixins
98
+
99
+ /**
100
+ * @description Sets align-items to flex-start - aligns items to the start of the cross axis.
101
+ * @dependencies flex | flex-inline
102
+ */
29
103
  @mixin x-start {align-items: flex-start;}
104
+
105
+ /**
106
+ * @description Sets align-items to flex-end - aligns items to the end of the cross axis.
107
+ * @dependencies flex | flex-inline
108
+ */
30
109
  @mixin x-end {align-items: flex-end;}
110
+
111
+ /**
112
+ * @description Sets align-items to center - aligns items to the center of the cross axis.
113
+ * @dependencies flex | flex-inline
114
+ */
31
115
  @mixin x-center {align-items: center;}
116
+
117
+ /**
118
+ * @description Sets align-items to stretch - aligns items to the stretch of the cross axis.
119
+ * @dependencies flex | flex-inline
120
+ */
32
121
  @mixin x-stretch {align-items: stretch;}
122
+
123
+ /**
124
+ * @description Sets align-items to baseline - aligns items to the baseline of the cross axis.
125
+ * @dependencies flex | flex-inline
126
+ */
33
127
  @mixin x-baseline {align-items: baseline;}
34
128
 
35
129
  // Cross Axis Content Mixins
130
+
131
+ /**
132
+ * @description Sets align-content to flex-start - aligns content to the start of the cross axis.
133
+ * @dependencies flex | flex-inline
134
+ */
36
135
  @mixin x-content-start { align-content: flex-start; }
136
+
137
+ /**
138
+ * @description Sets align-content to flex-end - aligns content to the end of the cross axis.
139
+ * @dependencies flex | flex-inline
140
+ */
37
141
  @mixin x-content-end { align-content: flex-end; }
142
+
143
+ /**
144
+ * @description Sets align-content to center - aligns content to the center of the cross axis.
145
+ * @dependencies flex | flex-inline
146
+ */
38
147
  @mixin x-content-center { align-content: center; }
148
+
149
+ /**
150
+ * @description Sets align-content to space-between - aligns content to the space between the cross axis.
151
+ * @dependencies flex | flex-inline
152
+ */
39
153
  @mixin x-content-between { align-content: space-between; }
154
+
155
+ /**
156
+ * @description Sets align-content to space-around - aligns content to the space around the cross axis.
157
+ * @dependencies flex | flex-inline
158
+ */
40
159
  @mixin x-content-around { align-content: space-around; }
160
+
161
+ /**
162
+ * @description Sets align-content to space-evenly - aligns content to the space evenly between the cross axis.
163
+ * @dependencies flex | flex-inline
164
+ */
41
165
  @mixin x-content-evenly { align-content: space-evenly; }
166
+
167
+ /**
168
+ * @description Sets align-content to stretch - aligns content to the stretch of the cross axis.
169
+ * @dependencies flex | flex-inline
170
+ */
42
171
  @mixin x-content-stretch { align-content: stretch; }
43
172
 
44
173
  // Self Alignment Mixins
174
+
175
+ /**
176
+ * @description Sets align-self to auto
177
+ * @dependencies flex | flex-inline
178
+ */
45
179
  @mixin self-auto {align-self: auto;}
180
+
181
+ /**
182
+ * @description Sets align-self to flex-start
183
+ * @dependencies flex | flex-inline
184
+ */
46
185
  @mixin self-start {align-self: flex-start;}
186
+
187
+ /**
188
+ * @description Sets align-self to flex-end
189
+ * @dependencies flex | flex-inline
190
+ */
47
191
  @mixin self-end {align-self: flex-end;}
192
+
193
+ /**
194
+ * @description Sets align-self to center
195
+ * @dependencies flex | flex-inline
196
+ */
48
197
  @mixin self-center {align-self: center;}
198
+
199
+ /**
200
+ * @description Sets align-self to stretch
201
+ * @dependencies flex | flex-inline
202
+ */
49
203
  @mixin self-stretch {align-self: stretch;}
50
204
 
205
+ /**
206
+ * @description Sets align-self to baseline
207
+ * @dependencies flex | flex-inline
208
+ */
209
+ @mixin self-baseline {align-self: baseline;}
210
+
211
+ /**
212
+ * @description Sets flex-shrink to 1 - allows the item to shrink.
213
+ * @dependencies flex | flex-inline
214
+ */
51
215
  @mixin shrink {flex-shrink: 1;}
216
+
217
+ /**
218
+ * @description Sets flex-shrink to 0 - prevents the item from shrinking.
219
+ * @dependencies flex | flex-inline
220
+ */
52
221
  @mixin shrink-0 {flex-shrink: 0;}
222
+
223
+ /**
224
+ * @description Sets flex-shrink to 2 - allows the item to shrink twice as much as the other items.
225
+ * @dependencies flex | flex-inline
226
+ */
53
227
  @mixin shrink-2 {flex-shrink: 2;}
54
228
 
229
+
55
230
  // Flex Child Mixins
231
+
232
+ /**
233
+ * @description Sets flex to 0 0 100%
234
+ */
56
235
  @mixin f-w-full {flex: 0 0 100%;}
236
+
237
+ /**
238
+ * @description Sets flex to 1 1 auto - allows the item to grow and shrink.
239
+ */
57
240
  @mixin f-w-auto {flex: 1 1 auto;}
241
+
242
+ /**
243
+ * @description Sets flex to 1 1 0% - allows the item to grow but not shrink.
244
+ */
58
245
  @mixin grow { flex: 1 1 0%; }
246
+
247
+ /**
248
+ * @description Sets flex to none - prevents the item from growing.
249
+ */
59
250
  @mixin no-grow { flex: none; }
60
251
 
252
+ /**
253
+ * @description Sets how many columns this would take using percentage of $column-count.
254
+ * @param {Number} $size - The number of columns to span.
255
+ */
61
256
  @mixin w-col($size) {
62
257
  flex: 0 0 math.percentage(math.div($size, $column-count));
63
258
  }
@@ -119,11 +314,14 @@
119
314
  }
120
315
  }
121
316
 
122
-
123
- // Responsive variants
124
317
  @each $breakpoint, $width in $breakpoints {
125
- @media (min-width: $width) {
126
- .flex {
318
+ // Get breakpoint value using FN function
319
+ $bp-val: FN.get-breakpoint-value($breakpoint);
320
+
321
+ @media (min-width: #{$bp-val}) {
322
+ .flex\@#{$breakpoint} {
323
+ display: flex;
324
+
127
325
  // Direction
128
326
  &.row\@#{$breakpoint} { flex-direction: row; }
129
327
  &.row-reverse\@#{$breakpoint} { flex-direction: row-reverse; }
@@ -1,14 +1,30 @@
1
+ // Section: Layout
2
+ // Module: Grid | Grid Inline
3
+
1
4
  @use 'sass:math';
5
+ @use '../utilities/functions' as FN;
2
6
  @use '../utilities/variables' as *;
3
7
 
4
- // Grid Container Mixins
8
+ /**
9
+ * @description Establishes a grid container.
10
+ */
5
11
  @mixin grid {display: grid;}
12
+
13
+ /**
14
+ * @description Establishes a inline-grid container.
15
+ */
6
16
  @mixin grid-inline {display: inline-grid;}
7
17
 
8
18
  // Grid Template Mixins
9
19
  @mixin cols($count) {grid-template-columns: repeat($count, minmax(0, 1fr));}
10
20
  @mixin rows($count) {grid-template-rows: repeat($count, minmax(0, 1fr));}
11
21
 
22
+ @mixin grid-cols-custom($template) {
23
+ // Convert underscores to spaces so "1fr_auto" becomes "1fr auto"
24
+ $converted: FN.str-replace($template, "_", " ");
25
+ grid-template-columns: $converted;
26
+ }
27
+
12
28
  // Auto-fit/fill Mixins
13
29
  @mixin auto-fit($min-width) {grid-template-columns: repeat(auto-fit, minmax($min-width, 1fr));}
14
30
  @mixin auto-fill($min-width) {grid-template-columns: repeat(auto-fill, minmax($min-width, 1fr));}
@@ -19,8 +35,23 @@
19
35
  @mixin flow-dense-items { grid-auto-flow: dense; }
20
36
 
21
37
  // Grid Alignment Mixins
38
+
39
+ /**
40
+ * @description justify-items container.
41
+ * @param {string} $value - The value for the justify-items property.
42
+ */
22
43
  @mixin justify-items($value) {justify-items: $value;}
44
+
45
+ /**
46
+ * @description Establishes a align-items container.
47
+ * @param {string} $value - The value for the align-items property.
48
+ */
23
49
  @mixin align-items($value) {align-items: $value;}
50
+
51
+ /**
52
+ * @description Establishes a place-items container.
53
+ * @param {string} $value - The value for the place-items property.
54
+ */
24
55
  @mixin place-items($value) {place-items: $value;}
25
56
 
26
57
  // Grid Item Placement Mixins
@@ -43,18 +74,26 @@
43
74
  }
44
75
 
45
76
 
77
+ /// EXAMPLE USAGE
78
+ .custom-grid {
79
+ display: grid;
80
+ @include grid-cols-custom("1fr_auto_1fr");
81
+ }
82
+
46
83
  // Classes
47
84
  .grid { @include grid; }
48
85
  .grid.inline { @include grid-inline; }
49
86
 
50
87
  // Grid Template Classes
51
- @for $i from 1 through $column-count {
52
- .grid.cols-#{$i} { @include cols($i); }
53
- .grid.rows-#{$i} { @include rows($i); }
54
-
55
- // Responsive grid columns
56
- @each $breakpoint, $width in $breakpoints {
57
- @media (min-width: $width) {
88
+ @each $breakpoint, $width in $breakpoints {
89
+ // Responsive grid columns
90
+ @media (min-width: #{$width}) {
91
+ .grid { @include grid; }
92
+
93
+ @for $i from 1 through $column-count {
94
+ .grid.cols-#{$i} { @include cols($i); }
95
+ .grid.rows-#{$i} { @include rows($i); }
96
+
58
97
  .grid.cols-#{$i}\@#{$breakpoint} {
59
98
  @include cols($i);
60
99
  }
@@ -73,7 +112,7 @@
73
112
  }
74
113
 
75
114
  @each $breakpoint, $width in $breakpoints {
76
- @media (min-width: $width) {
115
+ @media (min-width: #{$width}) {
77
116
  .span-col-#{$i}\@#{$breakpoint} {
78
117
  @include span-col($i);
79
118
  }
@@ -111,14 +150,14 @@ $alignments: (
111
150
  .place-items-#{$name} { place-items: $value; }
112
151
 
113
152
  @each $breakpoint, $width in $breakpoints {
114
- @media (min-width: $width) {
153
+ @media (min-width: #{$width}) {
115
154
  .justify-items-#{$name}\@#{$breakpoint} {
116
155
  justify-items: $value;
117
156
  }
118
157
  .align-items-#{$name}\@#{$breakpoint} {
119
158
  align-items: $value;
120
159
  }
121
- .place-items-#{$name}\@#{$breakpoint} {
160
+ .place-items-#{$name}\@#{$breakpoint} {
122
161
  place-items: $value;
123
162
  }
124
163
  }