mastors-gridder 1.0.0
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/README.MD +1130 -0
- package/_mastors-gridder.scss +323 -0
- package/package.json +59 -0
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
// ===============================
|
|
2
|
+
// COMPREHENSIVE GRID MIXINS
|
|
3
|
+
// ===============================
|
|
4
|
+
|
|
5
|
+
// -------------------------------
|
|
6
|
+
// AUTO-FIT RESPONSIVE GRID
|
|
7
|
+
// -------------------------------
|
|
8
|
+
// Creates a responsive grid that automatically fits columns
|
|
9
|
+
@mixin grid-auto($min: 250px, $gap: 1rem) {
|
|
10
|
+
display: grid;
|
|
11
|
+
grid-template-columns: repeat(auto-fit, minmax($min, 1fr));
|
|
12
|
+
gap: $gap;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// -------------------------------
|
|
16
|
+
// AUTO-FILL RESPONSIVE GRID
|
|
17
|
+
// -------------------------------
|
|
18
|
+
// Creates a responsive grid that fills with empty columns
|
|
19
|
+
@mixin grid-fill($min: 250px, $gap: 1rem) {
|
|
20
|
+
display: grid;
|
|
21
|
+
grid-template-columns: repeat(auto-fill, minmax($min, 1fr));
|
|
22
|
+
gap: $gap;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// -------------------------------
|
|
26
|
+
// FIXED COLUMN GRID
|
|
27
|
+
// -------------------------------
|
|
28
|
+
// Creates a grid with a specific number of columns
|
|
29
|
+
@mixin grid-cols($cols: 12, $gap: 1rem) {
|
|
30
|
+
display: grid;
|
|
31
|
+
grid-template-columns: repeat($cols, 1fr);
|
|
32
|
+
gap: $gap;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// -------------------------------
|
|
36
|
+
// FIXED ROW GRID
|
|
37
|
+
// -------------------------------
|
|
38
|
+
// Creates a grid with a specific number of rows
|
|
39
|
+
@mixin grid-rows($rows: 3, $gap: 1rem) {
|
|
40
|
+
display: grid;
|
|
41
|
+
grid-template-rows: repeat($rows, 1fr);
|
|
42
|
+
gap: $gap;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// -------------------------------
|
|
46
|
+
// CUSTOM TEMPLATE GRID
|
|
47
|
+
// -------------------------------
|
|
48
|
+
// Creates a grid with custom column sizes
|
|
49
|
+
@mixin grid-template($template, $gap: 1rem) {
|
|
50
|
+
display: grid;
|
|
51
|
+
grid-template-columns: $template;
|
|
52
|
+
gap: $gap;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// -------------------------------
|
|
56
|
+
// CENTERED GRID ITEM
|
|
57
|
+
// -------------------------------
|
|
58
|
+
// Centers content within a grid cell
|
|
59
|
+
@mixin grid-center {
|
|
60
|
+
display: grid;
|
|
61
|
+
place-items: center;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// -------------------------------
|
|
65
|
+
// GRID ITEM SPAN
|
|
66
|
+
// -------------------------------
|
|
67
|
+
// Makes a grid item span across columns/rows
|
|
68
|
+
@mixin grid-span($col-span: 1, $row-span: 1) {
|
|
69
|
+
grid-column: span $col-span;
|
|
70
|
+
grid-row: span $row-span;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// -------------------------------
|
|
74
|
+
// GRID AREA PLACEMENT
|
|
75
|
+
// -------------------------------
|
|
76
|
+
// Places item in specific grid area
|
|
77
|
+
@mixin grid-area($col-start, $col-end, $row-start: auto, $row-end: auto) {
|
|
78
|
+
grid-column: #{$col-start} / #{$col-end};
|
|
79
|
+
|
|
80
|
+
@if $row-start !=auto {
|
|
81
|
+
grid-row: #{$row-start} / #{$row-end};
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// -------------------------------
|
|
86
|
+
// HOLY GRAIL LAYOUT
|
|
87
|
+
// -------------------------------
|
|
88
|
+
// Classic header/sidebar/content/footer layout
|
|
89
|
+
@mixin grid-holy-grail($sidebar-width: 250px, $gap: 1rem) {
|
|
90
|
+
display: grid;
|
|
91
|
+
grid-template-columns: $sidebar-width 1fr $sidebar-width;
|
|
92
|
+
grid-template-rows: auto 1fr auto;
|
|
93
|
+
grid-template-areas:
|
|
94
|
+
"header header header"
|
|
95
|
+
"sidebar-left content sidebar-right"
|
|
96
|
+
"footer footer footer";
|
|
97
|
+
gap: $gap;
|
|
98
|
+
min-height: 100vh;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// -------------------------------
|
|
102
|
+
// MASONRY-STYLE GRID
|
|
103
|
+
// -------------------------------
|
|
104
|
+
// Creates a masonry layout effect
|
|
105
|
+
@mixin grid-masonry($cols: 3, $gap: 1rem) {
|
|
106
|
+
display: grid;
|
|
107
|
+
grid-template-columns: repeat($cols, 1fr);
|
|
108
|
+
grid-auto-rows: 10px;
|
|
109
|
+
gap: $gap;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// -------------------------------
|
|
113
|
+
// SIDEBAR LAYOUT
|
|
114
|
+
// -------------------------------
|
|
115
|
+
// Creates a sidebar + main content layout
|
|
116
|
+
@mixin grid-sidebar($sidebar-width: 300px, $gap: 1rem, $position: left) {
|
|
117
|
+
display: grid;
|
|
118
|
+
gap: $gap;
|
|
119
|
+
|
|
120
|
+
@if $position ==left {
|
|
121
|
+
grid-template-columns: $sidebar-width 1fr;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
@else {
|
|
125
|
+
grid-template-columns: 1fr $sidebar-width;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// -------------------------------
|
|
130
|
+
// RESPONSIVE SIDEBAR
|
|
131
|
+
// -------------------------------
|
|
132
|
+
// Sidebar that stacks on mobile
|
|
133
|
+
@mixin grid-sidebar-responsive($sidebar-width: 300px, $gap: 1rem, $breakpoint: 768px) {
|
|
134
|
+
display: grid;
|
|
135
|
+
gap: $gap;
|
|
136
|
+
grid-template-columns: 1fr;
|
|
137
|
+
|
|
138
|
+
@media (min-width: $breakpoint) {
|
|
139
|
+
grid-template-columns: $sidebar-width 1fr;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// -------------------------------
|
|
144
|
+
// DENSE GRID
|
|
145
|
+
// -------------------------------
|
|
146
|
+
// Fills gaps by placing items densely
|
|
147
|
+
@mixin grid-dense($min: 150px, $gap: 1rem) {
|
|
148
|
+
display: grid;
|
|
149
|
+
grid-template-columns: repeat(auto-fit, minmax($min, 1fr));
|
|
150
|
+
grid-auto-flow: dense;
|
|
151
|
+
gap: $gap;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// -------------------------------
|
|
155
|
+
// EQUAL HEIGHT ROWS
|
|
156
|
+
// -------------------------------
|
|
157
|
+
// Creates rows with equal height
|
|
158
|
+
@mixin grid-equal-rows($rows: 3, $gap: 1rem) {
|
|
159
|
+
display: grid;
|
|
160
|
+
grid-auto-rows: 1fr;
|
|
161
|
+
gap: $gap;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// -------------------------------
|
|
165
|
+
// FULL BLEED GRID
|
|
166
|
+
// -------------------------------
|
|
167
|
+
// Grid that allows items to break out
|
|
168
|
+
@mixin grid-full-bleed($content-width: 1200px, $gap: 1rem) {
|
|
169
|
+
display: grid;
|
|
170
|
+
grid-template-columns: 1fr min(#{$content-width}, 100%) 1fr;
|
|
171
|
+
gap: $gap;
|
|
172
|
+
|
|
173
|
+
>* {
|
|
174
|
+
grid-column: 2;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// -------------------------------
|
|
179
|
+
// CARD GRID
|
|
180
|
+
// -------------------------------
|
|
181
|
+
// Responsive card grid with min/max sizes
|
|
182
|
+
@mixin grid-cards($min: 280px, $max: 1fr, $gap: 1.5rem) {
|
|
183
|
+
display: grid;
|
|
184
|
+
grid-template-columns: repeat(auto-fit, minmax(min($min, 100%), $max));
|
|
185
|
+
gap: $gap;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// -------------------------------
|
|
189
|
+
// ASYMMETRIC GRID
|
|
190
|
+
// -------------------------------
|
|
191
|
+
// Creates an asymmetric 2-column layout
|
|
192
|
+
@mixin grid-asymmetric($ratio: 2, $gap: 1rem) {
|
|
193
|
+
display: grid;
|
|
194
|
+
grid-template-columns: #{$ratio}fr 1fr;
|
|
195
|
+
gap: $gap;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// -------------------------------
|
|
199
|
+
// STACKED GRID
|
|
200
|
+
// -------------------------------
|
|
201
|
+
// Mobile-first stacked grid that expands
|
|
202
|
+
@mixin grid-stacked($cols: 2, $gap: 1rem, $breakpoint: 640px) {
|
|
203
|
+
display: grid;
|
|
204
|
+
grid-template-columns: 1fr;
|
|
205
|
+
gap: $gap;
|
|
206
|
+
|
|
207
|
+
@media (min-width: $breakpoint) {
|
|
208
|
+
grid-template-columns: repeat($cols, 1fr);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// -------------------------------
|
|
213
|
+
// GRID ALIGNMENT UTILITIES
|
|
214
|
+
// -------------------------------
|
|
215
|
+
@mixin grid-align($justify: center, $align: center) {
|
|
216
|
+
display: grid;
|
|
217
|
+
justify-items: $justify;
|
|
218
|
+
align-items: $align;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// -------------------------------
|
|
222
|
+
// GRID GAP UTILITIES
|
|
223
|
+
// -------------------------------
|
|
224
|
+
@mixin grid-gap($row-gap: 1rem, $col-gap: 1rem) {
|
|
225
|
+
display: grid;
|
|
226
|
+
row-gap: $row-gap;
|
|
227
|
+
column-gap: $col-gap;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// -------------------------------
|
|
231
|
+
// SUBGRID MIXIN
|
|
232
|
+
// -------------------------------
|
|
233
|
+
// Creates a subgrid (CSS Subgrid)
|
|
234
|
+
@mixin grid-subgrid($rows: true, $cols: true) {
|
|
235
|
+
display: grid;
|
|
236
|
+
|
|
237
|
+
@if $cols {
|
|
238
|
+
grid-template-columns: subgrid;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
@if $rows {
|
|
242
|
+
grid-template-rows: subgrid;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
// -------------------------------
|
|
247
|
+
// GRID WITH NAMED LINES
|
|
248
|
+
// -------------------------------
|
|
249
|
+
@mixin grid-named-lines($cols, $rows: auto) {
|
|
250
|
+
display: grid;
|
|
251
|
+
grid-template-columns: $cols;
|
|
252
|
+
|
|
253
|
+
@if $rows !=auto {
|
|
254
|
+
grid-template-rows: $rows;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// -------------------------------
|
|
259
|
+
// GRID ORDER
|
|
260
|
+
// -------------------------------
|
|
261
|
+
@mixin grid-order($order: 0) {
|
|
262
|
+
order: $order;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
// -------------------------------
|
|
266
|
+
// GRID JUSTIFY & ALIGN SELF
|
|
267
|
+
// -------------------------------
|
|
268
|
+
@mixin grid-self($justify: auto, $align: auto) {
|
|
269
|
+
justify-self: $justify;
|
|
270
|
+
align-self: $align;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
// ===============================
|
|
274
|
+
// USAGE EXAMPLES
|
|
275
|
+
// ===============================
|
|
276
|
+
|
|
277
|
+
/*
|
|
278
|
+
// Auto-fit grid
|
|
279
|
+
.gallery {
|
|
280
|
+
@include grid-auto(300px, 2rem);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
// Fixed columns
|
|
284
|
+
.dashboard {
|
|
285
|
+
@include grid-cols(4, 1.5rem);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
// Sidebar layout
|
|
289
|
+
.layout {
|
|
290
|
+
@include grid-sidebar(250px, 2rem);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
// Card grid
|
|
294
|
+
.products {
|
|
295
|
+
@include grid-cards(300px, 1fr, 2rem);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
// Centered content
|
|
299
|
+
.hero {
|
|
300
|
+
@include grid-center;
|
|
301
|
+
min-height: 400px;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
// Span multiple columns
|
|
305
|
+
.featured {
|
|
306
|
+
@include grid-span(2, 1);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
// Holy grail layout
|
|
310
|
+
.page {
|
|
311
|
+
@include grid-holy-grail(200px, 1rem);
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
// Custom template
|
|
315
|
+
.custom {
|
|
316
|
+
@include grid-template(200px 1fr 200px, 1rem);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
// Responsive stacked
|
|
320
|
+
.cards {
|
|
321
|
+
@include grid-stacked(3, 1.5rem, 768px);
|
|
322
|
+
}
|
|
323
|
+
*/
|
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mastors-gridder",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "A lightweight SCSS grid and layout utility with responsive mixins and CSS helpers for building flexible layouts, from simple grids to Holy Grail structures.",
|
|
5
|
+
"main": "_mastors-gridder.scss",
|
|
6
|
+
"files": [
|
|
7
|
+
"_mastors-gridder.scss"
|
|
8
|
+
],
|
|
9
|
+
"keywords": [
|
|
10
|
+
"scss",
|
|
11
|
+
"sass",
|
|
12
|
+
"css",
|
|
13
|
+
"grid",
|
|
14
|
+
"grid system",
|
|
15
|
+
"responsive",
|
|
16
|
+
"responsive grid",
|
|
17
|
+
"layout",
|
|
18
|
+
"layout system",
|
|
19
|
+
"flexbox",
|
|
20
|
+
"css grid",
|
|
21
|
+
"holy grail layout",
|
|
22
|
+
"columns",
|
|
23
|
+
"rows",
|
|
24
|
+
"breakpoints",
|
|
25
|
+
"media queries",
|
|
26
|
+
"mixins",
|
|
27
|
+
"utilities",
|
|
28
|
+
"utility classes",
|
|
29
|
+
"sass mixins",
|
|
30
|
+
"scss mixins",
|
|
31
|
+
"sass utilities",
|
|
32
|
+
"scss utilities",
|
|
33
|
+
"sass library",
|
|
34
|
+
"scss library",
|
|
35
|
+
"sass responsive",
|
|
36
|
+
"scss responsive",
|
|
37
|
+
"frontend",
|
|
38
|
+
"ui layout",
|
|
39
|
+
"web layout",
|
|
40
|
+
"css framework",
|
|
41
|
+
"lightweight css",
|
|
42
|
+
"modular css",
|
|
43
|
+
"design system",
|
|
44
|
+
"css helpers",
|
|
45
|
+
"css cdn",
|
|
46
|
+
"mastors",
|
|
47
|
+
"gridder"
|
|
48
|
+
],
|
|
49
|
+
"author": "KEHEM-IT",
|
|
50
|
+
"license": "MIT",
|
|
51
|
+
"repository": {
|
|
52
|
+
"type": "git",
|
|
53
|
+
"url": "git+https://github.com/KEHEM-IT/Mastors-Gridder.git"
|
|
54
|
+
},
|
|
55
|
+
"bugs": {
|
|
56
|
+
"url": "https://github.com/KEHEM-IT/Mastors-Gridder/issues"
|
|
57
|
+
},
|
|
58
|
+
"homepage": "https://github.com/KEHEM-IT/Mastors-Gridder#readme"
|
|
59
|
+
}
|