@nuvoui/core 1.1.4 → 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/dist/nuvoui.min.css +1 -0
- package/package.json +2 -1
- package/src/styles/base/_base.scss +17 -0
- package/src/styles/index.scss +8 -5
- package/src/styles/layouts/_container.scss +10 -19
- package/src/styles/layouts/_flex.scss +247 -24
- package/src/styles/layouts/_grid.scss +88 -68
- package/src/styles/mixins-map.scss +224 -126
- package/src/styles/themes/_theme.scss +29 -2
- package/src/styles/utilities/_borders.scss +2 -5
- package/src/styles/utilities/_colors.scss +6 -6
- package/src/styles/utilities/_container-queries.scss +58 -0
- package/src/styles/utilities/_display.scss +59 -16
- package/src/styles/utilities/_functions.scss +27 -2
- package/src/styles/utilities/_helpers.scss +128 -0
- package/src/styles/utilities/_media-queries.scss +34 -50
- package/src/styles/utilities/_opacity.scss +1 -1
- package/src/styles/utilities/_position.scss +2 -2
- package/src/styles/utilities/_sizing.scss +23 -5
- package/src/styles/utilities/_spacing.scss +1 -1
- package/src/styles/utilities/_typography.scss +65 -17
- package/src/styles/utilities/_variables.scss +12 -20
- package/dist/nuvoui.css +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuvoui/core",
|
|
3
|
-
"version": "1.1.
|
|
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",
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
/* Import variables */
|
|
4
4
|
@use '../utilities/variables' as *;
|
|
5
|
+
@use '../utilities/media-queries' as media;
|
|
5
6
|
|
|
6
7
|
:root {
|
|
7
8
|
--font-family-base: system-ui, -apple-system, "BlinkMacSystemFont", 'Segoe UI', "Roboto", "Oxygen", "Ubuntu", "Cantarell", sans-serif;
|
|
@@ -181,3 +182,19 @@ a {
|
|
|
181
182
|
border: 0 !important;
|
|
182
183
|
}
|
|
183
184
|
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
code {
|
|
188
|
+
font-family: 'Courier New', Courier, monospace;
|
|
189
|
+
background-color: #f8f8f8;
|
|
190
|
+
color: #d63384;
|
|
191
|
+
padding: 2px 6px;
|
|
192
|
+
border-radius: 3px;
|
|
193
|
+
box-shadow: 0 2px 4px rgb(0 0 0 / 10%);
|
|
194
|
+
white-space: nowrap;
|
|
195
|
+
|
|
196
|
+
@include media.dark-mode {
|
|
197
|
+
background-color: #333;
|
|
198
|
+
color: #f8f8f2;
|
|
199
|
+
}
|
|
200
|
+
}
|
package/src/styles/index.scss
CHANGED
|
@@ -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,7 +1,7 @@
|
|
|
1
1
|
@use 'sass:map';
|
|
2
2
|
@use '../utilities/variables' as *;
|
|
3
3
|
|
|
4
|
-
//
|
|
4
|
+
// Base container styles
|
|
5
5
|
@mixin container-base {
|
|
6
6
|
width: 100%;
|
|
7
7
|
margin-left: auto;
|
|
@@ -10,39 +10,30 @@
|
|
|
10
10
|
padding-right: 1rem;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
// Responsive container mixin
|
|
14
|
+
@mixin container($display: block) {
|
|
14
15
|
@include container-base;
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
display: $display;
|
|
18
|
+
|
|
19
|
+
@each $breakpoint, $width in $container-max-widths {
|
|
20
|
+
@media (min-width: map.get($breakpoints, $breakpoint)) {
|
|
21
|
+
max-width: $width;
|
|
21
22
|
}
|
|
22
23
|
}
|
|
23
24
|
}
|
|
24
25
|
|
|
25
|
-
@mixin container-flex {
|
|
26
|
-
display: flex;
|
|
27
|
-
@include container;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
@mixin container-grid {
|
|
31
|
-
display: grid;
|
|
32
|
-
@include container;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
26
|
// Container classes
|
|
36
27
|
.container {
|
|
37
28
|
@include container;
|
|
38
29
|
}
|
|
39
30
|
|
|
40
31
|
.container-flex {
|
|
41
|
-
@include container
|
|
32
|
+
@include container(flex);
|
|
42
33
|
}
|
|
43
34
|
|
|
44
35
|
.container-grid {
|
|
45
|
-
@include container
|
|
36
|
+
@include container(grid);
|
|
46
37
|
}
|
|
47
38
|
|
|
48
39
|
.container-fluid {
|
|
@@ -1,54 +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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
@
|
|
32
|
-
@
|
|
33
|
-
|
|
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
|
+
*/
|
|
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
|
+
*/
|
|
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
|
+
*/
|
|
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
|
+
*/
|
|
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
|
+
*/
|
|
127
|
+
@mixin x-baseline {align-items: baseline;}
|
|
128
|
+
|
|
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
|
+
*/
|
|
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
|
+
*/
|
|
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
|
+
*/
|
|
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
|
+
*/
|
|
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
|
+
*/
|
|
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
|
+
*/
|
|
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
|
+
*/
|
|
171
|
+
@mixin x-content-stretch { align-content: stretch; }
|
|
34
172
|
|
|
35
173
|
// Self Alignment Mixins
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* @description Sets align-self to auto
|
|
177
|
+
* @dependencies flex | flex-inline
|
|
178
|
+
*/
|
|
36
179
|
@mixin self-auto {align-self: auto;}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* @description Sets align-self to flex-start
|
|
183
|
+
* @dependencies flex | flex-inline
|
|
184
|
+
*/
|
|
37
185
|
@mixin self-start {align-self: flex-start;}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* @description Sets align-self to flex-end
|
|
189
|
+
* @dependencies flex | flex-inline
|
|
190
|
+
*/
|
|
38
191
|
@mixin self-end {align-self: flex-end;}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* @description Sets align-self to center
|
|
195
|
+
* @dependencies flex | flex-inline
|
|
196
|
+
*/
|
|
39
197
|
@mixin self-center {align-self: center;}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* @description Sets align-self to stretch
|
|
201
|
+
* @dependencies flex | flex-inline
|
|
202
|
+
*/
|
|
40
203
|
@mixin self-stretch {align-self: stretch;}
|
|
41
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
|
+
*/
|
|
42
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
|
+
*/
|
|
43
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
|
+
*/
|
|
44
227
|
@mixin shrink-2 {flex-shrink: 2;}
|
|
45
228
|
|
|
229
|
+
|
|
46
230
|
// Flex Child Mixins
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* @description Sets flex to 0 0 100%
|
|
234
|
+
*/
|
|
47
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
|
+
*/
|
|
48
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
|
+
*/
|
|
49
245
|
@mixin grow { flex: 1 1 0%; }
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* @description Sets flex to none - prevents the item from growing.
|
|
249
|
+
*/
|
|
50
250
|
@mixin no-grow { flex: none; }
|
|
51
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
|
+
*/
|
|
52
256
|
@mixin w-col($size) {
|
|
53
257
|
flex: 0 0 math.percentage(math.div($size, $column-count));
|
|
54
258
|
}
|
|
@@ -77,12 +281,20 @@
|
|
|
77
281
|
&.evenly { justify-content: space-evenly; }
|
|
78
282
|
|
|
79
283
|
// Align modifiers
|
|
80
|
-
&.
|
|
81
|
-
&.
|
|
82
|
-
&.
|
|
83
|
-
&.
|
|
84
|
-
&.
|
|
284
|
+
&.x-start { align-items: flex-start; }
|
|
285
|
+
&.x-end { align-items: flex-end; }
|
|
286
|
+
&.x-center { align-items: center; }
|
|
287
|
+
&.x-baseline { align-items: baseline; }
|
|
288
|
+
&.x-stretch { align-items: stretch; }
|
|
85
289
|
|
|
290
|
+
&.x-content-start { align-content: flex-start; }
|
|
291
|
+
&.x-content-end { align-content: flex-end; }
|
|
292
|
+
&.x-content-center { align-content: center; }
|
|
293
|
+
&.x-content-between { align-content: space-between; }
|
|
294
|
+
&.x-content-around { align-content: space-around; }
|
|
295
|
+
&.x-content-evenly { align-content: space-evenly; }
|
|
296
|
+
&.x-content-stretch { align-content: stretch; }
|
|
297
|
+
|
|
86
298
|
// Child flex items (using column count)
|
|
87
299
|
> .w-auto { @include f-w-auto }
|
|
88
300
|
> .w-full { @include f-w-full }
|
|
@@ -102,11 +314,14 @@
|
|
|
102
314
|
}
|
|
103
315
|
}
|
|
104
316
|
|
|
105
|
-
|
|
106
|
-
// Responsive variants
|
|
107
317
|
@each $breakpoint, $width in $breakpoints {
|
|
108
|
-
|
|
109
|
-
|
|
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
|
+
|
|
110
325
|
// Direction
|
|
111
326
|
&.row\@#{$breakpoint} { flex-direction: row; }
|
|
112
327
|
&.row-reverse\@#{$breakpoint} { flex-direction: row-reverse; }
|
|
@@ -127,12 +342,20 @@
|
|
|
127
342
|
&.evenly\@#{$breakpoint} { justify-content: space-evenly; }
|
|
128
343
|
|
|
129
344
|
// Align
|
|
130
|
-
&.
|
|
131
|
-
&.
|
|
132
|
-
&.
|
|
133
|
-
&.
|
|
134
|
-
&.
|
|
345
|
+
&.x-start\@#{$breakpoint} { align-items: flex-start; }
|
|
346
|
+
&.x-end\@#{$breakpoint} { align-items: flex-end; }
|
|
347
|
+
&.x-center\@#{$breakpoint} { align-items: center; }
|
|
348
|
+
&.x-baseline\@#{$breakpoint} { align-items: baseline; }
|
|
349
|
+
&.x-stretch\@#{$breakpoint} { align-items: stretch; }
|
|
135
350
|
|
|
351
|
+
&.x-content-start\@#{$breakpoint} { align-content: flex-start; }
|
|
352
|
+
&.x-content-end\@#{$breakpoint} { align-content: flex-end; }
|
|
353
|
+
&.x-content-center\@#{$breakpoint} { align-content: center; }
|
|
354
|
+
&.x-content-between\@#{$breakpoint} { align-content: space-between; }
|
|
355
|
+
&.x-content-around\@#{$breakpoint} { align-content: space-around; }
|
|
356
|
+
&.x-content-evenly\@#{$breakpoint} { align-content: space-evenly; }
|
|
357
|
+
&.x-content-stretch\@#{$breakpoint} { align-content: stretch; }
|
|
358
|
+
|
|
136
359
|
// Width (using column count)
|
|
137
360
|
& > .w-auto\@#{$breakpoint} { @include f-w-auto; }
|
|
138
361
|
& > .w-full\@#{$breakpoint} { @include f-w-full; }
|
|
@@ -1,73 +1,83 @@
|
|
|
1
|
+
// Section: Layout
|
|
2
|
+
// Module: Grid | Grid Inline
|
|
3
|
+
|
|
4
|
+
@use 'sass:math';
|
|
5
|
+
@use '../utilities/functions' as FN;
|
|
1
6
|
@use '../utilities/variables' as *;
|
|
2
7
|
|
|
3
|
-
|
|
4
|
-
@
|
|
5
|
-
|
|
6
|
-
}
|
|
8
|
+
/**
|
|
9
|
+
* @description Establishes a grid container.
|
|
10
|
+
*/
|
|
11
|
+
@mixin grid {display: grid;}
|
|
7
12
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
13
|
+
/**
|
|
14
|
+
* @description Establishes a inline-grid container.
|
|
15
|
+
*/
|
|
16
|
+
@mixin grid-inline {display: inline-grid;}
|
|
11
17
|
|
|
12
18
|
// Grid Template Mixins
|
|
13
|
-
@mixin
|
|
14
|
-
|
|
15
|
-
}
|
|
19
|
+
@mixin cols($count) {grid-template-columns: repeat($count, minmax(0, 1fr));}
|
|
20
|
+
@mixin rows($count) {grid-template-rows: repeat($count, minmax(0, 1fr));}
|
|
16
21
|
|
|
17
|
-
@mixin grid-
|
|
18
|
-
|
|
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;
|
|
19
26
|
}
|
|
20
27
|
|
|
21
28
|
// Auto-fit/fill Mixins
|
|
22
|
-
@mixin grid-auto-fit($min-width)
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
@mixin grid-auto-fill($min-width) {
|
|
27
|
-
grid-template-columns: repeat(auto-fill, minmax($min-width, 1fr));
|
|
28
|
-
}
|
|
29
|
+
@mixin auto-fit($min-width) {grid-template-columns: repeat(auto-fit, minmax($min-width, 1fr));}
|
|
30
|
+
@mixin auto-fill($min-width) {grid-template-columns: repeat(auto-fill, minmax($min-width, 1fr));}
|
|
29
31
|
|
|
30
32
|
// Grid Flow Mixins
|
|
31
|
-
@mixin
|
|
32
|
-
@mixin
|
|
33
|
-
@mixin
|
|
33
|
+
@mixin flow-in-row { grid-auto-flow: row; }
|
|
34
|
+
@mixin flow-in-col { grid-auto-flow: column; }
|
|
35
|
+
@mixin flow-dense-items { grid-auto-flow: dense; }
|
|
34
36
|
|
|
35
37
|
// Grid Alignment Mixins
|
|
36
|
-
@mixin justify-items($value) {
|
|
37
|
-
justify-items: $value;
|
|
38
|
-
}
|
|
39
38
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
39
|
+
/**
|
|
40
|
+
* @description justify-items container.
|
|
41
|
+
* @param {string} $value - The value for the justify-items property.
|
|
42
|
+
*/
|
|
43
|
+
@mixin justify-items($value) {justify-items: $value;}
|
|
43
44
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
45
|
+
/**
|
|
46
|
+
* @description Establishes a align-items container.
|
|
47
|
+
* @param {string} $value - The value for the align-items property.
|
|
48
|
+
*/
|
|
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
|
+
*/
|
|
55
|
+
@mixin place-items($value) {place-items: $value;}
|
|
47
56
|
|
|
48
57
|
// Grid Item Placement Mixins
|
|
49
|
-
@mixin col
|
|
50
|
-
|
|
51
|
-
}
|
|
58
|
+
@mixin span-col($span) {grid-column: span $span / span $span;}
|
|
59
|
+
@mixin span-row($span) {grid-row: span $span / span $span;}
|
|
60
|
+
@mixin col-start($start) {grid-column-start: $start;}
|
|
61
|
+
@mixin col-end($end) {grid-column-end: $end;}
|
|
62
|
+
@mixin row-start($start) {grid-row-start: $start;}
|
|
63
|
+
@mixin row-end($end) {grid-row-end: $end;}
|
|
52
64
|
|
|
53
|
-
@mixin
|
|
54
|
-
grid-
|
|
65
|
+
@mixin grid-position($col, $row) {
|
|
66
|
+
grid-column: $col;
|
|
67
|
+
grid-row: $row;
|
|
55
68
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
grid-column-start: $start;
|
|
69
|
+
@mixin position-col($col) {
|
|
70
|
+
grid-column: $start;
|
|
59
71
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
grid-column-end: $end;
|
|
72
|
+
@mixin position-row($row) {
|
|
73
|
+
grid-row: $row;
|
|
63
74
|
}
|
|
64
75
|
|
|
65
|
-
@mixin row-start($start) {
|
|
66
|
-
grid-row-start: $start;
|
|
67
|
-
}
|
|
68
76
|
|
|
69
|
-
|
|
70
|
-
|
|
77
|
+
/// EXAMPLE USAGE
|
|
78
|
+
.custom-grid {
|
|
79
|
+
display: grid;
|
|
80
|
+
@include grid-cols-custom("1fr_auto_1fr");
|
|
71
81
|
}
|
|
72
82
|
|
|
73
83
|
// Classes
|
|
@@ -75,15 +85,17 @@
|
|
|
75
85
|
.grid.inline { @include grid-inline; }
|
|
76
86
|
|
|
77
87
|
// Grid Template Classes
|
|
78
|
-
@
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
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
|
+
|
|
97
|
+
.grid.cols-#{$i}\@#{$breakpoint} {
|
|
98
|
+
@include cols($i);
|
|
87
99
|
}
|
|
88
100
|
}
|
|
89
101
|
}
|
|
@@ -91,14 +103,22 @@
|
|
|
91
103
|
|
|
92
104
|
// Generate Column Span Classes with Responsive Variants
|
|
93
105
|
@for $i from 1 through $column-count {
|
|
94
|
-
.col
|
|
95
|
-
@include col
|
|
106
|
+
.span-col-#{$i} {
|
|
107
|
+
@include span-col($i);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.span-row-#{$i} {
|
|
111
|
+
@include span-row($i);
|
|
96
112
|
}
|
|
97
113
|
|
|
98
114
|
@each $breakpoint, $width in $breakpoints {
|
|
99
|
-
@media (min-width: $width) {
|
|
100
|
-
.col
|
|
101
|
-
@include col
|
|
115
|
+
@media (min-width: #{$width}) {
|
|
116
|
+
.span-col-#{$i}\@#{$breakpoint} {
|
|
117
|
+
@include span-col($i);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.span-row-#{$i}\@#{$breakpoint} {
|
|
121
|
+
@include span-row($i);
|
|
102
122
|
}
|
|
103
123
|
}
|
|
104
124
|
}
|
|
@@ -107,14 +127,14 @@
|
|
|
107
127
|
|
|
108
128
|
// Auto-fit/fill Classes
|
|
109
129
|
@each $breakpoint, $width in $breakpoints {
|
|
110
|
-
.grid.auto-fit-#{$breakpoint} { @include
|
|
111
|
-
.grid.auto-fill-#{$breakpoint} { @include
|
|
130
|
+
.grid.auto-fit-#{$breakpoint} { @include auto-fit($width); }
|
|
131
|
+
.grid.auto-fill-#{$breakpoint} { @include auto-fill($width); }
|
|
112
132
|
}
|
|
113
133
|
|
|
114
134
|
// Flow Classes
|
|
115
|
-
.grid.flow-row { @include
|
|
116
|
-
.grid.flow-col { @include
|
|
117
|
-
.grid.flow-dense { @include
|
|
135
|
+
.grid.flow-row { @include flow-in-row; }
|
|
136
|
+
.grid.flow-col { @include flow-in-col; }
|
|
137
|
+
.grid.flow-dense { @include flow-dense-items; }
|
|
118
138
|
|
|
119
139
|
// Alignment Classes
|
|
120
140
|
$alignments: (
|
|
@@ -130,14 +150,14 @@ $alignments: (
|
|
|
130
150
|
.place-items-#{$name} { place-items: $value; }
|
|
131
151
|
|
|
132
152
|
@each $breakpoint, $width in $breakpoints {
|
|
133
|
-
@media (min-width: $width) {
|
|
153
|
+
@media (min-width: #{$width}) {
|
|
134
154
|
.justify-items-#{$name}\@#{$breakpoint} {
|
|
135
155
|
justify-items: $value;
|
|
136
156
|
}
|
|
137
157
|
.align-items-#{$name}\@#{$breakpoint} {
|
|
138
158
|
align-items: $value;
|
|
139
159
|
}
|
|
140
|
-
.place-items-#{$name}\@#{$breakpoint} {
|
|
160
|
+
.place-items-#{$name}\@#{$breakpoint} {
|
|
141
161
|
place-items: $value;
|
|
142
162
|
}
|
|
143
163
|
}
|