mastors-gridder 1.0.0 → 1.3.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.
@@ -5,7 +5,6 @@
5
5
  // -------------------------------
6
6
  // AUTO-FIT RESPONSIVE GRID
7
7
  // -------------------------------
8
- // Creates a responsive grid that automatically fits columns
9
8
  @mixin grid-auto($min: 250px, $gap: 1rem) {
10
9
  display: grid;
11
10
  grid-template-columns: repeat(auto-fit, minmax($min, 1fr));
@@ -15,17 +14,24 @@
15
14
  // -------------------------------
16
15
  // AUTO-FILL RESPONSIVE GRID
17
16
  // -------------------------------
18
- // Creates a responsive grid that fills with empty columns
19
17
  @mixin grid-fill($min: 250px, $gap: 1rem) {
20
18
  display: grid;
21
19
  grid-template-columns: repeat(auto-fill, minmax($min, 1fr));
22
20
  gap: $gap;
23
21
  }
24
22
 
23
+ // -------------------------------
24
+ // GRID CONTAINER
25
+ // -------------------------------
26
+ @mixin grid-container($cols: 12, $gap: 1rem) {
27
+ display: grid;
28
+ grid-template-columns: repeat($cols, 1fr);
29
+ gap: $gap;
30
+ }
31
+
25
32
  // -------------------------------
26
33
  // FIXED COLUMN GRID
27
34
  // -------------------------------
28
- // Creates a grid with a specific number of columns
29
35
  @mixin grid-cols($cols: 12, $gap: 1rem) {
30
36
  display: grid;
31
37
  grid-template-columns: repeat($cols, 1fr);
@@ -35,7 +41,6 @@
35
41
  // -------------------------------
36
42
  // FIXED ROW GRID
37
43
  // -------------------------------
38
- // Creates a grid with a specific number of rows
39
44
  @mixin grid-rows($rows: 3, $gap: 1rem) {
40
45
  display: grid;
41
46
  grid-template-rows: repeat($rows, 1fr);
@@ -45,7 +50,6 @@
45
50
  // -------------------------------
46
51
  // CUSTOM TEMPLATE GRID
47
52
  // -------------------------------
48
- // Creates a grid with custom column sizes
49
53
  @mixin grid-template($template, $gap: 1rem) {
50
54
  display: grid;
51
55
  grid-template-columns: $template;
@@ -55,7 +59,6 @@
55
59
  // -------------------------------
56
60
  // CENTERED GRID ITEM
57
61
  // -------------------------------
58
- // Centers content within a grid cell
59
62
  @mixin grid-center {
60
63
  display: grid;
61
64
  place-items: center;
@@ -64,7 +67,6 @@
64
67
  // -------------------------------
65
68
  // GRID ITEM SPAN
66
69
  // -------------------------------
67
- // Makes a grid item span across columns/rows
68
70
  @mixin grid-span($col-span: 1, $row-span: 1) {
69
71
  grid-column: span $col-span;
70
72
  grid-row: span $row-span;
@@ -73,7 +75,6 @@
73
75
  // -------------------------------
74
76
  // GRID AREA PLACEMENT
75
77
  // -------------------------------
76
- // Places item in specific grid area
77
78
  @mixin grid-area($col-start, $col-end, $row-start: auto, $row-end: auto) {
78
79
  grid-column: #{$col-start} / #{$col-end};
79
80
 
@@ -85,7 +86,6 @@
85
86
  // -------------------------------
86
87
  // HOLY GRAIL LAYOUT
87
88
  // -------------------------------
88
- // Classic header/sidebar/content/footer layout
89
89
  @mixin grid-holy-grail($sidebar-width: 250px, $gap: 1rem) {
90
90
  display: grid;
91
91
  grid-template-columns: $sidebar-width 1fr $sidebar-width;
@@ -101,7 +101,6 @@
101
101
  // -------------------------------
102
102
  // MASONRY-STYLE GRID
103
103
  // -------------------------------
104
- // Creates a masonry layout effect
105
104
  @mixin grid-masonry($cols: 3, $gap: 1rem) {
106
105
  display: grid;
107
106
  grid-template-columns: repeat($cols, 1fr);
@@ -112,7 +111,6 @@
112
111
  // -------------------------------
113
112
  // SIDEBAR LAYOUT
114
113
  // -------------------------------
115
- // Creates a sidebar + main content layout
116
114
  @mixin grid-sidebar($sidebar-width: 300px, $gap: 1rem, $position: left) {
117
115
  display: grid;
118
116
  gap: $gap;
@@ -129,7 +127,6 @@
129
127
  // -------------------------------
130
128
  // RESPONSIVE SIDEBAR
131
129
  // -------------------------------
132
- // Sidebar that stacks on mobile
133
130
  @mixin grid-sidebar-responsive($sidebar-width: 300px, $gap: 1rem, $breakpoint: 768px) {
134
131
  display: grid;
135
132
  gap: $gap;
@@ -143,7 +140,6 @@
143
140
  // -------------------------------
144
141
  // DENSE GRID
145
142
  // -------------------------------
146
- // Fills gaps by placing items densely
147
143
  @mixin grid-dense($min: 150px, $gap: 1rem) {
148
144
  display: grid;
149
145
  grid-template-columns: repeat(auto-fit, minmax($min, 1fr));
@@ -154,7 +150,6 @@
154
150
  // -------------------------------
155
151
  // EQUAL HEIGHT ROWS
156
152
  // -------------------------------
157
- // Creates rows with equal height
158
153
  @mixin grid-equal-rows($rows: 3, $gap: 1rem) {
159
154
  display: grid;
160
155
  grid-auto-rows: 1fr;
@@ -164,7 +159,6 @@
164
159
  // -------------------------------
165
160
  // FULL BLEED GRID
166
161
  // -------------------------------
167
- // Grid that allows items to break out
168
162
  @mixin grid-full-bleed($content-width: 1200px, $gap: 1rem) {
169
163
  display: grid;
170
164
  grid-template-columns: 1fr min(#{$content-width}, 100%) 1fr;
@@ -178,7 +172,6 @@
178
172
  // -------------------------------
179
173
  // CARD GRID
180
174
  // -------------------------------
181
- // Responsive card grid with min/max sizes
182
175
  @mixin grid-cards($min: 280px, $max: 1fr, $gap: 1.5rem) {
183
176
  display: grid;
184
177
  grid-template-columns: repeat(auto-fit, minmax(min($min, 100%), $max));
@@ -188,7 +181,6 @@
188
181
  // -------------------------------
189
182
  // ASYMMETRIC GRID
190
183
  // -------------------------------
191
- // Creates an asymmetric 2-column layout
192
184
  @mixin grid-asymmetric($ratio: 2, $gap: 1rem) {
193
185
  display: grid;
194
186
  grid-template-columns: #{$ratio}fr 1fr;
@@ -198,7 +190,6 @@
198
190
  // -------------------------------
199
191
  // STACKED GRID
200
192
  // -------------------------------
201
- // Mobile-first stacked grid that expands
202
193
  @mixin grid-stacked($cols: 2, $gap: 1rem, $breakpoint: 640px) {
203
194
  display: grid;
204
195
  grid-template-columns: 1fr;
@@ -230,17 +221,24 @@
230
221
  // -------------------------------
231
222
  // SUBGRID MIXIN
232
223
  // -------------------------------
233
- // Creates a subgrid (CSS Subgrid)
234
- @mixin grid-subgrid($rows: true, $cols: true) {
224
+ @mixin grid-subgrid($rows: true, $cols: true, $fallback: 1fr) {
235
225
  display: grid;
236
226
 
237
227
  @if $cols {
238
228
  grid-template-columns: subgrid;
239
229
  }
240
230
 
231
+ @else {
232
+ grid-template-columns: $fallback;
233
+ }
234
+
241
235
  @if $rows {
242
236
  grid-template-rows: subgrid;
243
237
  }
238
+
239
+ @else {
240
+ grid-template-rows: $fallback;
241
+ }
244
242
  }
245
243
 
246
244
  // -------------------------------
@@ -270,11 +268,190 @@
270
268
  align-self: $align;
271
269
  }
272
270
 
271
+ // -------------------------------
272
+ // GRID AUTO-FLOW CONTROL
273
+ // -------------------------------
274
+ @mixin grid-auto-flow($direction: row, $dense: false) {
275
+ display: grid;
276
+
277
+ @if $dense {
278
+ grid-auto-flow: #{$direction} dense;
279
+ }
280
+
281
+ @else {
282
+ grid-auto-flow: $direction;
283
+ }
284
+ }
285
+
286
+ // -------------------------------
287
+ // GRID MINMAX UTILITY
288
+ // -------------------------------
289
+ @mixin grid-minmax($min, $max, $cols: auto-fit, $gap: 1rem) {
290
+ display: grid;
291
+ grid-template-columns: repeat($cols, minmax($min, $max));
292
+ gap: $gap;
293
+ }
294
+
295
+ // -------------------------------
296
+ // GRID CONTENT ALIGNMENT
297
+ // -------------------------------
298
+ @mixin grid-content($justify: center, $align: center) {
299
+ display: grid;
300
+ justify-content: $justify;
301
+ align-content: $align;
302
+ }
303
+
304
+ // -------------------------------
305
+ // GRID AUTO ROWS
306
+ // -------------------------------
307
+ @mixin grid-auto-rows($size: auto) {
308
+ display: grid;
309
+ grid-auto-rows: $size;
310
+ }
311
+
312
+ // -------------------------------
313
+ // GRID AUTO COLUMNS
314
+ // -------------------------------
315
+ @mixin grid-auto-cols($size: auto) {
316
+ display: grid;
317
+ grid-auto-columns: $size;
318
+ }
319
+
320
+ // -------------------------------
321
+ // GRID OVERLAY/LAYERING
322
+ // -------------------------------
323
+ @mixin grid-layer($col-start: 1, $col-end: -1, $row-start: 1, $row-end: -1) {
324
+ grid-column: #{$col-start} / #{$col-end};
325
+ grid-row: #{$row-start} / #{$row-end};
326
+ }
327
+
328
+ // -------------------------------
329
+ // GRID FR UNITS
330
+ // -------------------------------
331
+ @mixin grid-fr($fr-values...) {
332
+ display: grid;
333
+ grid-template-columns: $fr-values;
334
+ }
335
+
336
+ // -------------------------------
337
+ // GRID INTRINSIC SIZING
338
+ // -------------------------------
339
+ @mixin grid-intrinsic($cols: auto-fit, $sizing: min-content, $gap: 1rem) {
340
+ display: grid;
341
+ grid-template-columns: repeat($cols, $sizing);
342
+ gap: $gap;
343
+ }
344
+
345
+ // -------------------------------
346
+ // GRID EXPLICIT ROWS & COLUMNS
347
+ // -------------------------------
348
+ @mixin grid-explicit($cols, $rows, $gap: 1rem) {
349
+ display: grid;
350
+ grid-template-columns: $cols;
351
+ grid-template-rows: $rows;
352
+ gap: $gap;
353
+ }
354
+
355
+ // -------------------------------
356
+ // RESPONSIVE GRID AREAS
357
+ // -------------------------------
358
+ @mixin grid-areas-responsive($mobile-areas, $desktop-areas, $breakpoint: 768px) {
359
+ display: grid;
360
+ grid-template-areas: $mobile-areas;
361
+
362
+ @media (min-width: $breakpoint) {
363
+ grid-template-areas: $desktop-areas;
364
+ }
365
+ }
366
+
367
+ // -------------------------------
368
+ // GRID FIT-CONTENT
369
+ // -------------------------------
370
+ @mixin grid-fit-content($max-width, $cols: auto-fit, $gap: 1rem) {
371
+ display: grid;
372
+ grid-template-columns: repeat($cols, fit-content($max-width));
373
+ gap: $gap;
374
+ }
375
+
376
+ // -------------------------------
377
+ // GRID REPEAT PATTERN
378
+ // -------------------------------
379
+ @mixin grid-repeat-pattern($pattern, $times: 1, $gap: 1rem) {
380
+ display: grid;
381
+ grid-template-columns: repeat($times, $pattern);
382
+ gap: $gap;
383
+ }
384
+
385
+ // -------------------------------
386
+ // GRID CONTAINER QUERY READY
387
+ // -------------------------------
388
+ @mixin grid-container-aware($min: 250px, $gap: 1rem) {
389
+ container-type: inline-size;
390
+ display: grid;
391
+ grid-template-columns: repeat(auto-fit, minmax($min, 1fr));
392
+ gap: $gap;
393
+ }
394
+
395
+ // -------------------------------
396
+ // GRID PLACE ITEMS SHORTHAND
397
+ // -------------------------------
398
+ @mixin grid-place($place: center) {
399
+ display: grid;
400
+ place-items: $place;
401
+ }
402
+
403
+ // -------------------------------
404
+ // GRID PLACE CONTENT SHORTHAND
405
+ // -------------------------------
406
+ @mixin grid-place-content($place: center) {
407
+ display: grid;
408
+ place-content: $place;
409
+ }
410
+
411
+ // -------------------------------
412
+ // GRID ITEM FULL WIDTH
413
+ // -------------------------------
414
+ @mixin grid-full-width {
415
+ grid-column: 1 / -1;
416
+ }
417
+
418
+ // -------------------------------
419
+ // GRID ITEM FULL HEIGHT
420
+ // -------------------------------
421
+ @mixin grid-full-height {
422
+ grid-row: 1 / -1;
423
+ }
424
+
425
+ // -------------------------------
426
+ // MODERN MASONRY GRID
427
+ // -------------------------------
428
+ @mixin grid-masonry-modern($cols: 3, $row-size: 50px, $gap: 1rem) {
429
+ display: grid;
430
+ grid-template-columns: repeat($cols, 1fr);
431
+ grid-auto-rows: $row-size;
432
+ grid-auto-flow: row dense;
433
+ gap: $gap;
434
+ }
435
+
436
+ // -------------------------------
437
+ // GRID AUTO TRACK
438
+ // -------------------------------
439
+ @mixin grid-auto-track($type: auto-fit, $min: 200px, $max: 1fr, $gap: 1rem) {
440
+ display: grid;
441
+ grid-template-columns: repeat($type, minmax($min, $max));
442
+ gap: $gap;
443
+ }
444
+
273
445
  // ===============================
274
446
  // USAGE EXAMPLES
275
447
  // ===============================
276
448
 
277
449
  /*
450
+ // Grid container
451
+ .container {
452
+ @include grid-container(12, 1rem);
453
+ }
454
+
278
455
  // Auto-fit grid
279
456
  .gallery {
280
457
  @include grid-auto(300px, 2rem);
@@ -320,4 +497,39 @@
320
497
  .cards {
321
498
  @include grid-stacked(3, 1.5rem, 768px);
322
499
  }
500
+
501
+ // Grid overlay for hero sections
502
+ .hero-overlay {
503
+ @include grid-layer(1, -1, 1, -1);
504
+ }
505
+
506
+ // Intrinsic sizing
507
+ .tag-list {
508
+ @include grid-intrinsic(auto-fit, max-content, 0.5rem);
509
+ }
510
+
511
+ // FR units
512
+ .layout {
513
+ @include grid-fr(2fr, 1fr, 1fr);
514
+ }
515
+
516
+ // Container aware grid
517
+ .responsive-cards {
518
+ @include grid-container-aware(280px, 1.5rem);
519
+ }
520
+
521
+ // Place items shorthand
522
+ .centered-box {
523
+ @include grid-place(center);
524
+ }
525
+
526
+ // Full width item
527
+ .full-width-banner {
528
+ @include grid-full-width;
529
+ }
530
+
531
+ // Modern masonry
532
+ .masonry-gallery {
533
+ @include grid-masonry-modern(4, 40px, 1rem);
534
+ }
323
535
  */
package/index.scss ADDED
@@ -0,0 +1,2 @@
1
+ // index.scss
2
+ @use './_mastors-fluider' as *;
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "mastors-gridder",
3
- "version": "1.0.0",
3
+ "version": "1.3.0",
4
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",
5
+ "main": "index.scss",
6
6
  "files": [
7
- "_mastors-gridder.scss"
7
+ "_mastors-gridder.scss",
8
+ "index.scss"
8
9
  ],
9
10
  "keywords": [
10
11
  "scss",
@@ -55,5 +56,5 @@
55
56
  "bugs": {
56
57
  "url": "https://github.com/KEHEM-IT/Mastors-Gridder/issues"
57
58
  },
58
- "homepage": "https://github.com/KEHEM-IT/Mastors-Gridder#readme"
59
+ "homepage": "https://mastorscdn.kehem.com/mastors-gridder"
59
60
  }