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 ADDED
@@ -0,0 +1,1130 @@
1
+ # Mastors-Gridder
2
+
3
+ **Comprehensive SCSS Grid System** - Professional-grade grid mixins for modern web layouts.
4
+
5
+ A powerful, flexible, and production-ready SASS grid utility library that provides everything you need to build responsive, complex layouts with ease.
6
+
7
+ ---
8
+
9
+ <p align="center">
10
+ <a href="./README-CSS.md">
11
+ <img src="https://img.shields.io/badge/CSS-DOCUMENTATION-2965f1?style=for-the-badge&logo=css&logoColor=white">
12
+ </a>
13
+ &nbsp;
14
+ <a href="https://kehem-it.github.io/Mastors-Gridder/">
15
+ <img src="https://img.shields.io/badge/FULL-DOCUMENTATION-2ea44f?style=for-the-badge&logo=readthedocs&logoColor=white">
16
+ </a>
17
+ </p>
18
+
19
+ ---
20
+
21
+
22
+ ## 📋 Table of Contents
23
+
24
+ - [Installation](#-installation)
25
+ - [Quick Start](#-quick-start)
26
+ - [Grid Mixins Overview](#-grid-mixins-overview)
27
+ - [Quick Reference Table](#-quick-reference-table)
28
+ - [Detailed Documentation](#-detailed-documentation)
29
+ - [Responsive Grid Mixins](#responsive-grid-mixins)
30
+ - [Fixed Grid Mixins](#fixed-grid-mixins)
31
+ - [Layout Pattern Mixins](#layout-pattern-mixins)
32
+ - [Grid Item Mixins](#grid-item-mixins)
33
+ - [Alignment & Utility Mixins](#alignment--utility-mixins)
34
+ - [Usage Examples](#-usage-examples)
35
+ - [Best Practices](#-best-practices)
36
+ - [Browser Support](#-browser-support)
37
+ - [FAQ](#-faq)
38
+ - [Changelog](#-changelog)
39
+
40
+ ---
41
+
42
+ ## 🚀 Installation
43
+
44
+ ### Via CDN (Recommended for Quick Start)
45
+
46
+ Add this link in your HTML `<head>`:
47
+
48
+ ```html
49
+ <link
50
+ rel="stylesheet"
51
+ href="https://cdn.jsdelivr.net/gh/KEHEM-IT/Mastors-Gridder@main/mastors-gridder.css"
52
+ />
53
+ ```
54
+
55
+ ### Via NPM
56
+
57
+ Install the package:
58
+
59
+ ```bash
60
+ npm i mastors-gridder
61
+ ```
62
+
63
+ Then import in your SCSS file:
64
+
65
+ ```scss
66
+ @use "mastors-gridder" as *;
67
+ ```
68
+
69
+ Or with a custom namespace:
70
+
71
+ ```scss
72
+ @use "mastors-gridder" as grid;
73
+
74
+ // Usage: @include grid.grid-auto(250px, 1rem);
75
+ ```
76
+
77
+ ### Manual Installation
78
+
79
+ Download `_mastors-gridder.scss` and import it:
80
+
81
+ ```scss
82
+ @import "path/to/mastors-gridder";
83
+ ```
84
+
85
+ ---
86
+
87
+ ## ⚡ Quick Start
88
+
89
+ ```scss
90
+ // Auto-fit responsive grid
91
+ .gallery {
92
+ @include grid-auto(300px, 2rem);
93
+ }
94
+
95
+ // Fixed 4-column grid
96
+ .dashboard {
97
+ @include grid-cols(4, 1.5rem);
98
+ }
99
+
100
+ // Sidebar layout
101
+ .layout {
102
+ @include grid-sidebar(250px, 2rem);
103
+ }
104
+
105
+ // Centered content
106
+ .hero {
107
+ @include grid-center;
108
+ min-height: 400px;
109
+ }
110
+
111
+ // Span multiple columns
112
+ .featured {
113
+ @include grid-span(2, 1);
114
+ }
115
+ ```
116
+
117
+ ---
118
+
119
+ ## 🎯 Grid Mixins Overview
120
+
121
+ | Category | Mixins | Use Case |
122
+ | -------------- | ---------------------------------------------------- | ---------------------- |
123
+ | **Responsive** | `grid-auto`, `grid-fill`, `grid-cards` | Auto-responsive grids |
124
+ | **Fixed** | `grid-cols`, `grid-rows`, `grid-template` | Fixed column/row grids |
125
+ | **Layouts** | `grid-sidebar`, `grid-holy-grail`, `grid-full-bleed` | Common layout patterns |
126
+ | **Items** | `grid-span`, `grid-area`, `grid-order` | Grid item positioning |
127
+ | **Alignment** | `grid-center`, `grid-align`, `grid-self` | Content alignment |
128
+ | **Utilities** | `grid-gap`, `grid-dense`, `grid-subgrid` | Special functionality |
129
+
130
+ ---
131
+
132
+ ## 📊 Quick Reference Table
133
+
134
+ Complete list of all mixins with parameters, defaults, and usage examples.
135
+
136
+ ### Responsive Grid Mixins
137
+
138
+ | Mixin | Parameters | Defaults | Usage Example |
139
+ | -------------- | ------------------------------ | ------------------------ | ------------------------------------------ |
140
+ | `grid-auto` | `$min`, `$gap` | `250px`, `1rem` | `@include grid-auto(300px, 2rem);` |
141
+ | `grid-fill` | `$min`, `$gap` | `250px`, `1rem` | `@include grid-fill(280px, 1.5rem);` |
142
+ | `grid-cards` | `$min`, `$max`, `$gap` | `280px`, `1fr`, `1.5rem` | `@include grid-cards(300px, 400px, 2rem);` |
143
+ | `grid-dense` | `$min`, `$gap` | `150px`, `1rem` | `@include grid-dense(200px, 1.5rem);` |
144
+ | `grid-stacked` | `$cols`, `$gap`, `$breakpoint` | `2`, `1rem`, `640px` | `@include grid-stacked(3, 1.5rem, 768px);` |
145
+
146
+ ### Fixed Grid Mixins
147
+
148
+ | Mixin | Parameters | Defaults | Usage Example |
149
+ | ----------------- | ------------------- | ---------------- | ------------------------------------------------ |
150
+ | `grid-cols` | `$cols`, `$gap` | `12`, `1rem` | `@include grid-cols(4, 1.5rem);` |
151
+ | `grid-rows` | `$rows`, `$gap` | `3`, `1rem` | `@include grid-rows(5, 2rem);` |
152
+ | `grid-template` | `$template`, `$gap` | required, `1rem` | `@include grid-template(200px 1fr 300px, 2rem);` |
153
+ | `grid-equal-rows` | `$rows`, `$gap` | `3`, `1rem` | `@include grid-equal-rows(4, 1rem);` |
154
+
155
+ ### Layout Pattern Mixins
156
+
157
+ | Mixin | Parameters | Defaults | Usage Example |
158
+ | ------------------------- | --------------------------------------- | ------------------------ | --------------------------------------------------------- |
159
+ | `grid-sidebar` | `$sidebar-width`, `$gap`, `$position` | `300px`, `1rem`, `left` | `@include grid-sidebar(250px, 2rem, left);` |
160
+ | `grid-sidebar-responsive` | `$sidebar-width`, `$gap`, `$breakpoint` | `300px`, `1rem`, `768px` | `@include grid-sidebar-responsive(280px, 1.5rem, 992px);` |
161
+ | `grid-holy-grail` | `$sidebar-width`, `$gap` | `250px`, `1rem` | `@include grid-holy-grail(200px, 1rem);` |
162
+ | `grid-full-bleed` | `$content-width`, `$gap` | `1200px`, `1rem` | `@include grid-full-bleed(800px, 2rem);` |
163
+ | `grid-masonry` | `$cols`, `$gap` | `3`, `1rem` | `@include grid-masonry(4, 1.5rem);` |
164
+ | `grid-asymmetric` | `$ratio`, `$gap` | `2`, `1rem` | `@include grid-asymmetric(3, 2rem);` |
165
+
166
+ ### Grid Item Mixins
167
+
168
+ | Mixin | Parameters | Defaults | Usage Example |
169
+ | ------------ | -------------------------------------------------- | ---------------------------------- | --------------------------------- |
170
+ | `grid-span` | `$col-span`, `$row-span` | `1`, `1` | `@include grid-span(2, 1);` |
171
+ | `grid-area` | `$col-start`, `$col-end`, `$row-start`, `$row-end` | required, required, `auto`, `auto` | `@include grid-area(1, 4, 2, 4);` |
172
+ | `grid-order` | `$order` | `0` | `@include grid-order(-1);` |
173
+
174
+ ### Alignment Mixins
175
+
176
+ | Mixin | Parameters | Defaults | Usage Example |
177
+ | ------------- | -------------------- | ------------------ | ------------------------------------- |
178
+ | `grid-center` | none | - | `@include grid-center;` |
179
+ | `grid-align` | `$justify`, `$align` | `center`, `center` | `@include grid-align(start, center);` |
180
+ | `grid-self` | `$justify`, `$align` | `auto`, `auto` | `@include grid-self(end, start);` |
181
+
182
+ ### Utility Mixins
183
+
184
+ | Mixin | Parameters | Defaults | Usage Example |
185
+ | -------------- | ---------------------- | -------------- | ------------------------------------- |
186
+ | `grid-gap` | `$row-gap`, `$col-gap` | `1rem`, `1rem` | `@include grid-gap(2rem, 1rem);` |
187
+ | `grid-subgrid` | `$rows`, `$cols` | `true`, `true` | `@include grid-subgrid(false, true);` |
188
+
189
+ ---
190
+
191
+ ## 📖 Detailed Documentation
192
+
193
+ ### Responsive Grid Mixins
194
+
195
+ #### `@mixin grid-auto($min, $gap)`
196
+
197
+ Creates a **responsive grid** that automatically fits as many columns as possible based on minimum width.
198
+
199
+ **Parameters:**
200
+
201
+ - `$min`: Minimum width per column (default: `250px`)
202
+ - `$gap`: Gap between items (default: `1rem`)
203
+
204
+ **Use case:** Image galleries, product cards, any content that should flow naturally
205
+
206
+ ```scss
207
+ .gallery {
208
+ @include grid-auto(300px, 2rem);
209
+ }
210
+
211
+ // Compiles to:
212
+ .gallery {
213
+ display: grid;
214
+ grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
215
+ gap: 2rem;
216
+ }
217
+ ```
218
+
219
+ ---
220
+
221
+ #### `@mixin grid-fill($min, $gap)`
222
+
223
+ Similar to `grid-auto`, but uses `auto-fill` instead of `auto-fit`. Creates **empty columns** if there's extra space.
224
+
225
+ **Parameters:**
226
+
227
+ - `$min`: Minimum width per column (default: `250px`)
228
+ - `$gap`: Gap between items (default: `1rem`)
229
+
230
+ **Difference from `grid-auto`:**
231
+
232
+ - `auto-fit`: Collapses empty tracks, items stretch to fill space
233
+ - `auto-fill`: Keeps empty tracks, items maintain consistent size
234
+
235
+ ```scss
236
+ .product-grid {
237
+ @include grid-fill(280px, 1.5rem);
238
+ }
239
+ ```
240
+
241
+ ---
242
+
243
+ #### `@mixin grid-cards($min, $max, $gap)`
244
+
245
+ Responsive card grid with **min/max constraints** for better control.
246
+
247
+ **Parameters:**
248
+
249
+ - `$min`: Minimum card width (default: `280px`)
250
+ - `$max`: Maximum card width (default: `1fr`)
251
+ - `$gap`: Gap between cards (default: `1.5rem`)
252
+
253
+ ```scss
254
+ .cards {
255
+ @include grid-cards(300px, 400px, 2rem);
256
+ }
257
+ ```
258
+
259
+ ---
260
+
261
+ ### Fixed Grid Mixins
262
+
263
+ #### `@mixin grid-cols($cols, $gap)`
264
+
265
+ Creates a grid with a **fixed number of columns**.
266
+
267
+ **Parameters:**
268
+
269
+ - `$cols`: Number of columns (default: `12`)
270
+ - `$gap`: Gap between items (default: `1rem`)
271
+
272
+ ```scss
273
+ .dashboard {
274
+ @include grid-cols(4, 1.5rem);
275
+ }
276
+
277
+ // Compiles to:
278
+ .dashboard {
279
+ display: grid;
280
+ grid-template-columns: repeat(4, 1fr);
281
+ gap: 1.5rem;
282
+ }
283
+ ```
284
+
285
+ ---
286
+
287
+ #### `@mixin grid-rows($rows, $gap)`
288
+
289
+ Creates a grid with a **fixed number of rows**.
290
+
291
+ **Parameters:**
292
+
293
+ - `$rows`: Number of rows (default: `3`)
294
+ - `$gap`: Gap between items (default: `1rem`)
295
+
296
+ ```scss
297
+ .vertical-layout {
298
+ @include grid-rows(5, 2rem);
299
+ }
300
+ ```
301
+
302
+ ---
303
+
304
+ #### `@mixin grid-template($template, $gap)`
305
+
306
+ Creates a grid with **custom column sizes**.
307
+
308
+ **Parameters:**
309
+
310
+ - `$template`: CSS grid-template-columns value
311
+ - `$gap`: Gap between items (default: `1rem`)
312
+
313
+ ```scss
314
+ .custom-layout {
315
+ @include grid-template(200px 1fr 300px, 2rem);
316
+ }
317
+
318
+ // Asymmetric layout
319
+ .blog {
320
+ @include grid-template(2fr 1fr, 1rem);
321
+ }
322
+ ```
323
+
324
+ ---
325
+
326
+ ### Layout Pattern Mixins
327
+
328
+ #### `@mixin grid-sidebar($sidebar-width, $gap, $position)`
329
+
330
+ Creates a **sidebar + main content** layout.
331
+
332
+ **Parameters:**
333
+
334
+ - `$sidebar-width`: Width of sidebar (default: `300px`)
335
+ - `$gap`: Gap between sidebar and content (default: `1rem`)
336
+ - `$position`: `left` or `right` (default: `left`)
337
+
338
+ ```scss
339
+ .layout {
340
+ @include grid-sidebar(250px, 2rem, left);
341
+ }
342
+
343
+ // Right sidebar
344
+ .layout-alt {
345
+ @include grid-sidebar(300px, 1.5rem, right);
346
+ }
347
+ ```
348
+
349
+ ---
350
+
351
+ #### `@mixin grid-sidebar-responsive($sidebar-width, $gap, $breakpoint)`
352
+
353
+ Sidebar that **stacks on mobile** and appears side-by-side on larger screens.
354
+
355
+ **Parameters:**
356
+
357
+ - `$sidebar-width`: Width of sidebar (default: `300px`)
358
+ - `$gap`: Gap between elements (default: `1rem`)
359
+ - `$breakpoint`: When to switch to sidebar layout (default: `768px`)
360
+
361
+ ```scss
362
+ .responsive-layout {
363
+ @include grid-sidebar-responsive(280px, 1.5rem, 992px);
364
+ }
365
+ ```
366
+
367
+ ---
368
+
369
+ #### `@mixin grid-holy-grail($sidebar-width, $gap)`
370
+
371
+ Classic **Holy Grail layout** (header, sidebar, content, footer).
372
+
373
+ **Parameters:**
374
+
375
+ - `$sidebar-width`: Width of sidebars (default: `250px`)
376
+ - `$gap`: Gap between elements (default: `1rem`)
377
+
378
+ ```scss
379
+ .page {
380
+ @include grid-holy-grail(200px, 1rem);
381
+ }
382
+
383
+ // HTML structure:
384
+ .page {
385
+ .header {
386
+ grid-area: header;
387
+ }
388
+ .sidebar-left {
389
+ grid-area: sidebar-left;
390
+ }
391
+ .content {
392
+ grid-area: content;
393
+ }
394
+ .sidebar-right {
395
+ grid-area: sidebar-right;
396
+ }
397
+ .footer {
398
+ grid-area: footer;
399
+ }
400
+ }
401
+ ```
402
+
403
+ ---
404
+
405
+ #### `@mixin grid-full-bleed($content-width, $gap)`
406
+
407
+ Grid that allows items to **break out** to full width while keeping content centered.
408
+
409
+ **Parameters:**
410
+
411
+ - `$content-width`: Max width of content area (default: `1200px`)
412
+ - `$gap`: Gap between items (default: `1rem`)
413
+
414
+ ```scss
415
+ .article {
416
+ @include grid-full-bleed(800px, 2rem);
417
+
418
+ > * {
419
+ grid-column: 2; // Default content column
420
+ }
421
+
422
+ .full-width-image {
423
+ grid-column: 1 / -1; // Break out to full width
424
+ }
425
+ }
426
+ ```
427
+
428
+ ---
429
+
430
+ #### `@mixin grid-masonry($cols, $gap)`
431
+
432
+ Creates a **masonry-style layout** effect.
433
+
434
+ **Parameters:**
435
+
436
+ - `$cols`: Number of columns (default: `3`)
437
+ - `$gap`: Gap between items (default: `1rem`)
438
+
439
+ ```scss
440
+ .masonry {
441
+ @include grid-masonry(4, 1.5rem);
442
+
443
+ .item {
444
+ grid-row-end: span 10; // Adjust based on content height
445
+ }
446
+ }
447
+ ```
448
+
449
+ ---
450
+
451
+ ### Grid Item Mixins
452
+
453
+ #### `@mixin grid-span($col-span, $row-span)`
454
+
455
+ Makes a grid item **span across multiple columns/rows**.
456
+
457
+ **Parameters:**
458
+
459
+ - `$col-span`: Number of columns to span (default: `1`)
460
+ - `$row-span`: Number of rows to span (default: `1`)
461
+
462
+ ```scss
463
+ .featured-card {
464
+ @include grid-span(2, 1); // Span 2 columns, 1 row
465
+ }
466
+
467
+ .large-item {
468
+ @include grid-span(3, 2); // Span 3 columns, 2 rows
469
+ }
470
+ ```
471
+
472
+ ---
473
+
474
+ #### `@mixin grid-area($col-start, $col-end, $row-start, $row-end)`
475
+
476
+ Places item in a **specific grid area**.
477
+
478
+ **Parameters:**
479
+
480
+ - `$col-start`: Starting column line
481
+ - `$col-end`: Ending column line
482
+ - `$row-start`: Starting row line (default: `auto`)
483
+ - `$row-end`: Ending row line (default: `auto`)
484
+
485
+ ```scss
486
+ .header {
487
+ @include grid-area(1, 4); // Columns 1-4
488
+ }
489
+
490
+ .sidebar {
491
+ @include grid-area(1, 2, 2, 4); // Columns 1-2, Rows 2-4
492
+ }
493
+ ```
494
+
495
+ ---
496
+
497
+ #### `@mixin grid-order($order)`
498
+
499
+ Changes the **visual order** of grid items without changing HTML.
500
+
501
+ **Parameters:**
502
+
503
+ - `$order`: Order value (default: `0`)
504
+
505
+ ```scss
506
+ .first {
507
+ @include grid-order(-1); // Appears first
508
+ }
509
+
510
+ .last {
511
+ @include grid-order(999); // Appears last
512
+ }
513
+ ```
514
+
515
+ ---
516
+
517
+ ### Alignment & Utility Mixins
518
+
519
+ #### `@mixin grid-center`
520
+
521
+ Centers content **both horizontally and vertically** within a grid cell.
522
+
523
+ ```scss
524
+ .hero {
525
+ @include grid-center;
526
+ min-height: 400px;
527
+ }
528
+
529
+ // Compiles to:
530
+ .hero {
531
+ display: grid;
532
+ place-items: center;
533
+ }
534
+ ```
535
+
536
+ ---
537
+
538
+ #### `@mixin grid-align($justify, $align)`
539
+
540
+ Aligns **all items** in the grid container.
541
+
542
+ **Parameters:**
543
+
544
+ - `$justify`: Horizontal alignment (default: `center`)
545
+ - `$align`: Vertical alignment (default: `center`)
546
+
547
+ **Values:** `start`, `end`, `center`, `stretch`
548
+
549
+ ```scss
550
+ .grid {
551
+ @include grid-align(start, center);
552
+ }
553
+ ```
554
+
555
+ ---
556
+
557
+ #### `@mixin grid-self($justify, $align)`
558
+
559
+ Aligns a **single grid item** within its cell.
560
+
561
+ **Parameters:**
562
+
563
+ - `$justify`: Horizontal self-alignment (default: `auto`)
564
+ - `$align`: Vertical self-alignment (default: `auto`)
565
+
566
+ ```scss
567
+ .special-item {
568
+ @include grid-self(end, start);
569
+ }
570
+ ```
571
+
572
+ ---
573
+
574
+ #### `@mixin grid-gap($row-gap, $col-gap)`
575
+
576
+ Sets **different gaps** for rows and columns.
577
+
578
+ **Parameters:**
579
+
580
+ - `$row-gap`: Vertical gap (default: `1rem`)
581
+ - `$col-gap`: Horizontal gap (default: `1rem`)
582
+
583
+ ```scss
584
+ .grid {
585
+ @include grid-gap(2rem, 1rem); // More vertical space
586
+ }
587
+ ```
588
+
589
+ ---
590
+
591
+ #### `@mixin grid-dense($min, $gap)`
592
+
593
+ Fills gaps by placing items **densely** (useful for varying item sizes).
594
+
595
+ **Parameters:**
596
+
597
+ - `$min`: Minimum item width (default: `150px`)
598
+ - `$gap`: Gap between items (default: `1rem`)
599
+
600
+ ```scss
601
+ .pinterest-style {
602
+ @include grid-dense(200px, 1.5rem);
603
+ }
604
+ ```
605
+
606
+ ---
607
+
608
+ #### `@mixin grid-equal-rows($rows, $gap)`
609
+
610
+ Creates rows with **equal height**.
611
+
612
+ **Parameters:**
613
+
614
+ - `$rows`: Number of rows (default: `3`)
615
+ - `$gap`: Gap between rows (default: `1rem`)
616
+
617
+ ```scss
618
+ .equal-height {
619
+ @include grid-equal-rows(4, 1rem);
620
+ }
621
+ ```
622
+
623
+ ---
624
+
625
+ #### `@mixin grid-subgrid($rows, $cols)`
626
+
627
+ Creates a **subgrid** (inherits parent grid lines).
628
+
629
+ **Parameters:**
630
+
631
+ - `$rows`: Use subgrid for rows (default: `true`)
632
+ - `$cols`: Use subgrid for columns (default: `true`)
633
+
634
+ ```scss
635
+ .parent {
636
+ @include grid-cols(4);
637
+ }
638
+
639
+ .nested-grid {
640
+ @include grid-span(2, 1);
641
+ @include grid-subgrid(false, true); // Inherit parent's columns
642
+ }
643
+ ```
644
+
645
+ ---
646
+
647
+ #### `@mixin grid-stacked($cols, $gap, $breakpoint)`
648
+
649
+ **Mobile-first stacked grid** that expands on larger screens.
650
+
651
+ **Parameters:**
652
+
653
+ - `$cols`: Number of columns on desktop (default: `2`)
654
+ - `$gap`: Gap between items (default: `1rem`)
655
+ - `$breakpoint`: When to switch to multi-column (default: `640px`)
656
+
657
+ ```scss
658
+ .cards {
659
+ @include grid-stacked(3, 1.5rem, 768px);
660
+ }
661
+ ```
662
+
663
+ ---
664
+
665
+ #### `@mixin grid-asymmetric($ratio, $gap)`
666
+
667
+ Creates an **asymmetric 2-column layout** with custom ratio.
668
+
669
+ **Parameters:**
670
+
671
+ - `$ratio`: Ratio of first column (default: `2`)
672
+ - `$gap`: Gap between columns (default: `1rem`)
673
+
674
+ ```scss
675
+ .blog-layout {
676
+ @include grid-asymmetric(3, 2rem); // 3:1 ratio (main content : sidebar)
677
+ }
678
+ ```
679
+
680
+ ---
681
+
682
+ ## 💡 Usage Examples
683
+
684
+ ### Responsive Image Gallery
685
+
686
+ ```scss
687
+ .gallery {
688
+ @include grid-auto(300px, 2rem);
689
+
690
+ img {
691
+ width: 100%;
692
+ height: 100%;
693
+ object-fit: cover;
694
+ border-radius: 8px;
695
+ }
696
+
697
+ .featured {
698
+ @include grid-span(2, 2);
699
+ }
700
+ }
701
+ ```
702
+
703
+ ---
704
+
705
+ ### Dashboard Layout
706
+
707
+ ```scss
708
+ .dashboard {
709
+ @include grid-template(250px 1fr, 1rem);
710
+ min-height: 100vh;
711
+
712
+ .sidebar {
713
+ @include grid-center;
714
+ background: #f5f5f5;
715
+ }
716
+
717
+ .main-content {
718
+ @include grid-cols(3, 1.5rem);
719
+ padding: 2rem;
720
+
721
+ .widget {
722
+ padding: 1.5rem;
723
+ background: white;
724
+ border-radius: 8px;
725
+
726
+ &.large {
727
+ @include grid-span(2, 1);
728
+ }
729
+ }
730
+ }
731
+ }
732
+ ```
733
+
734
+ ---
735
+
736
+ ### Blog Layout with Sidebar
737
+
738
+ ```scss
739
+ .blog {
740
+ @include grid-sidebar-responsive(300px, 2rem, 992px);
741
+
742
+ .article {
743
+ @include grid-rows(auto 1fr auto, 1rem);
744
+
745
+ .article-header {
746
+ /* ... */
747
+ }
748
+ .article-content {
749
+ /* ... */
750
+ }
751
+ .article-footer {
752
+ /* ... */
753
+ }
754
+ }
755
+
756
+ .sidebar {
757
+ .widget {
758
+ padding: 1.5rem;
759
+ margin-bottom: 1rem;
760
+ }
761
+ }
762
+ }
763
+ ```
764
+
765
+ ---
766
+
767
+ ### Card Grid with Dense Packing
768
+
769
+ ```scss
770
+ .products {
771
+ @include grid-dense(280px, 1.5rem);
772
+
773
+ .product-card {
774
+ background: white;
775
+ border-radius: 8px;
776
+ padding: 1rem;
777
+
778
+ &.featured {
779
+ @include grid-span(2, 2);
780
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
781
+ color: white;
782
+ }
783
+
784
+ &.sale {
785
+ @include grid-span(1, 2);
786
+ }
787
+ }
788
+ }
789
+ ```
790
+
791
+ ---
792
+
793
+ ### Full-Width Content Sections
794
+
795
+ ```scss
796
+ .article {
797
+ @include grid-full-bleed(800px, 2rem);
798
+
799
+ h1,
800
+ p,
801
+ ul {
802
+ grid-column: 2; // Content column
803
+ }
804
+
805
+ .full-width-image {
806
+ grid-column: 1 / -1; // Break out to full width
807
+ width: 100%;
808
+ height: 500px;
809
+ object-fit: cover;
810
+ }
811
+
812
+ .highlight-box {
813
+ grid-column: 1 / -1;
814
+ background: #f0f0f0;
815
+ padding: 2rem;
816
+ text-align: center;
817
+ }
818
+ }
819
+ ```
820
+
821
+ ---
822
+
823
+ ### Responsive Navigation
824
+
825
+ ```scss
826
+ .nav {
827
+ @include grid-stacked(4, 1rem, 768px);
828
+
829
+ a {
830
+ @include grid-center;
831
+ padding: 1rem;
832
+ text-decoration: none;
833
+
834
+ &:hover {
835
+ background: #f0f0f0;
836
+ }
837
+ }
838
+ }
839
+ ```
840
+
841
+ ---
842
+
843
+ ### Holy Grail Layout
844
+
845
+ ```scss
846
+ .page-layout {
847
+ @include grid-holy-grail(200px, 1rem);
848
+
849
+ .header {
850
+ grid-area: header;
851
+ @include grid-center;
852
+ background: #333;
853
+ color: white;
854
+ padding: 1rem;
855
+ }
856
+
857
+ .sidebar-left {
858
+ grid-area: sidebar-left;
859
+ background: #f5f5f5;
860
+ }
861
+
862
+ .content {
863
+ grid-area: content;
864
+ @include grid-auto(300px, 1.5rem);
865
+ }
866
+
867
+ .sidebar-right {
868
+ grid-area: sidebar-right;
869
+ background: #f5f5f5;
870
+ }
871
+
872
+ .footer {
873
+ grid-area: footer;
874
+ @include grid-center;
875
+ background: #222;
876
+ color: white;
877
+ padding: 2rem;
878
+ }
879
+ }
880
+ ```
881
+
882
+ ---
883
+
884
+ ## ✅ Best Practices
885
+
886
+ ### 1. **Choose the Right Mixin**
887
+
888
+ - Use `grid-auto()` for **content that should flow naturally** (galleries, products)
889
+ - Use `grid-cols()` for **fixed layouts** (dashboards, forms)
890
+ - Use `grid-sidebar()` for **classic two-column layouts**
891
+ - Use `grid-template()` for **precise control** over column sizes
892
+
893
+ ---
894
+
895
+ ### 2. **Mobile-First Approach**
896
+
897
+ Start with mobile styles and use responsive mixins to adapt:
898
+
899
+ ```scss
900
+ .cards {
901
+ // Mobile: 1 column
902
+ @include grid-cols(1, 1rem);
903
+
904
+ @media (min-width: 768px) {
905
+ // Tablet: 2 columns
906
+ @include grid-cols(2, 1.5rem);
907
+ }
908
+
909
+ @media (min-width: 1024px) {
910
+ // Desktop: auto-responsive
911
+ @include grid-auto(300px, 2rem);
912
+ }
913
+ }
914
+ ```
915
+
916
+ ---
917
+
918
+ ### 3. **Consistent Gap Values**
919
+
920
+ Define gap variables for consistency:
921
+
922
+ ```scss
923
+ $gap-sm: 0.5rem;
924
+ $gap-md: 1rem;
925
+ $gap-lg: 1.5rem;
926
+ $gap-xl: 2rem;
927
+
928
+ .grid {
929
+ @include grid-auto(300px, $gap-lg);
930
+ }
931
+ ```
932
+
933
+ ---
934
+
935
+ ### 4. **Semantic Class Names**
936
+
937
+ Use descriptive class names that explain purpose:
938
+
939
+ ```scss
940
+ // ✅ Good
941
+ .product-grid {
942
+ @include grid-auto(280px);
943
+ }
944
+ .article-layout {
945
+ @include grid-sidebar(300px);
946
+ }
947
+
948
+ // ❌ Avoid
949
+ .grid-1 {
950
+ @include grid-auto(280px);
951
+ }
952
+ .layout-2 {
953
+ @include grid-sidebar(300px);
954
+ }
955
+ ```
956
+
957
+ ---
958
+
959
+ ### 5. **Combine Mixins Thoughtfully**
960
+
961
+ ```scss
962
+ .complex-layout {
963
+ @include grid-sidebar(250px, 2rem);
964
+
965
+ .sidebar {
966
+ @include grid-rows(auto 1fr auto);
967
+ }
968
+
969
+ .main-content {
970
+ @include grid-auto(300px, 1.5rem);
971
+
972
+ .featured {
973
+ @include grid-span(2, 1);
974
+ }
975
+ }
976
+ }
977
+ ```
978
+
979
+ ---
980
+
981
+ ### 6. **Test Responsiveness**
982
+
983
+ Always test with:
984
+
985
+ - Different screen sizes (mobile, tablet, desktop)
986
+ - Different content amounts (1 item, 10 items, 100 items)
987
+ - Different item sizes (varying heights, widths)
988
+
989
+ ---
990
+
991
+ ### 7. **Use Subgrid When Appropriate**
992
+
993
+ For nested grids that need to align with parent:
994
+
995
+ ```scss
996
+ .parent {
997
+ @include grid-cols(4);
998
+
999
+ .nested {
1000
+ @include grid-span(2, 1);
1001
+ @include grid-subgrid(false, true); // Align with parent columns
1002
+ }
1003
+ }
1004
+ ```
1005
+
1006
+ ---
1007
+
1008
+ ## 🌐 Browser Support
1009
+
1010
+ - **Modern Browsers:** Chrome 57+, Firefox 52+, Safari 10.1+, Edge 16+
1011
+ - **CSS Grid:** 95%+ global support
1012
+ - **Subgrid:** Chrome 117+, Firefox 71+, Safari 16+ (use fallbacks for older browsers)
1013
+
1014
+ ---
1015
+
1016
+ ## ❓ FAQ
1017
+
1018
+ ### Can I use this with Bootstrap or Tailwind?
1019
+
1020
+ Yes! Mastors-Gridder is framework-agnostic and works alongside any CSS framework. Use it for custom grid layouts where framework utilities fall short.
1021
+
1022
+ ---
1023
+
1024
+ ### Why SCSS mixins instead of CSS classes?
1025
+
1026
+ **Advantages of mixins:**
1027
+
1028
+ - More semantic HTML (no utility class clutter)
1029
+ - Greater flexibility and customization
1030
+ - Better for component-based architecture
1031
+ - Compile-time optimizations
1032
+ - No CSS bloat from unused classes
1033
+
1034
+ ---
1035
+
1036
+ ### How do I handle IE11?
1037
+
1038
+ CSS Grid is not fully supported in IE11. Use feature queries:
1039
+
1040
+ ```scss
1041
+ .grid {
1042
+ display: flex; // Fallback
1043
+ flex-wrap: wrap;
1044
+
1045
+ @supports (display: grid) {
1046
+ @include grid-auto(300px);
1047
+ }
1048
+ }
1049
+ ```
1050
+
1051
+ ---
1052
+
1053
+ ### Can I customize the mixins?
1054
+
1055
+ Absolutely! Copy the mixin code and modify parameters, add new features, or create your own custom mixins based on these templates.
1056
+
1057
+ ---
1058
+
1059
+ ### How do I debug grid layouts?
1060
+
1061
+ Use browser DevTools:
1062
+
1063
+ ```scss
1064
+ // Temporary debug styles
1065
+ .grid {
1066
+ @include grid-auto(300px);
1067
+
1068
+ > * {
1069
+ border: 1px solid red; // Visualize grid items
1070
+ }
1071
+ }
1072
+ ```
1073
+
1074
+ Or use Firefox Grid Inspector / Chrome Grid Overlay tools.
1075
+
1076
+ ---
1077
+
1078
+ ### What's the performance impact?
1079
+
1080
+ CSS Grid is highly performant and hardware-accelerated. These mixins compile to standard CSS Grid properties with no runtime overhead.
1081
+
1082
+ ---
1083
+
1084
+ ## 📋 Changelog
1085
+
1086
+ ### Version 1.0.0
1087
+
1088
+ **Released:** December 30, 2025 - Initial Release
1089
+
1090
+ #### 🎉 Features
1091
+
1092
+ - ⭐ 25+ production-ready grid mixins
1093
+ - ⭐ Responsive grid utilities (auto-fit, auto-fill)
1094
+ - ⭐ Common layout patterns (sidebar, holy grail, full-bleed)
1095
+ - ⭐ Grid item positioning mixins (span, area, order)
1096
+ - ⭐ Alignment utilities (center, align, self)
1097
+ - ⭐ Advanced features (subgrid, dense packing, masonry)
1098
+ - ⭐ Comprehensive documentation with real-world examples
1099
+ - ⭐ Mobile-first approach with responsive helpers
1100
+ - ⭐ Zero dependencies, framework-agnostic
1101
+
1102
+ ---
1103
+
1104
+ ## 📄 License
1105
+
1106
+ Free to use in personal and commercial projects.
1107
+
1108
+ ---
1109
+
1110
+ ## 🤝 Contributing
1111
+
1112
+ Found an issue or have a suggestion? Contributions are welcome!
1113
+
1114
+ 1. Fork the repository
1115
+ 2. Create your feature branch
1116
+ 3. Commit your changes
1117
+ 4. Push to the branch
1118
+ 5. Open a Pull Request
1119
+
1120
+ ---
1121
+
1122
+ ## 🔗 Related Projects
1123
+
1124
+ - [Mastors-Fluider](https://github.com/KEHEM-IT/Mastors-Fluider) - Responsive breakpoint utility system
1125
+
1126
+ ---
1127
+
1128
+ **Maintained by:** [KEHEM-IT](https://github.com/KEHEM-IT)
1129
+ **License:** Free to Use
1130
+ **Version:** 1.0.0