Mastors Gridder

Mastors Gridder

v1.0.0 - Latest Release

Modern SASS Grid Mixin Utility Library & CSS CDN

A comprehensive collection of SCSS mixins and CSS utility classes for building responsive grid layouts with ease. From simple galleries to complex Holy Grail layouts.

25+
SCSS Mixins
100+
CSS Classes
~15KB
File Size

Overview

Responsive First

Built with auto-fit, auto-fill, and responsive patterns for all screen sizes.

Dual Implementation

Choose between powerful SCSS mixins or ready-to-use CSS utility classes.

Layout Patterns

Pre-built patterns like Holy Grail, Sidebar, Masonry, and more.

Lightweight

Optimized for performance with minimal CSS footprint.

Flexible

Customizable mixins with parameters for any grid layout need.

Production Ready

Battle-tested utilities for modern web applications.

Perfect For:

Responsive image galleries
Dashboard layouts
Product grids
Card-based interfaces
Blog post layouts
Complex page structures

Installation

Via CDN (Recommended)

Add this link in your HTML <head>:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/KEHEM-IT/Mastors-Gridder@main/mastors-gridder.css">

Via NPM

Install via npm (coming soon):

npm install mastors-gridder

For SCSS Projects

Import the SCSS file in your project:

@use 'mastors-gridder/mastors-gridder' as *;

// Usage
.gallery {
  @include grid-auto(300px, 2rem);
}

Installation Complete!

You can now use grid mixins in SCSS or utility classes in HTML.

SCSS Mixins

grid-auto() - Auto-Fit Responsive Grid

Creates a responsive grid that automatically fits columns based on available space.

Parameters:

  • $min - Minimum column width (default: 250px)
  • $gap - Gap between items (default: 1rem)
.gallery {
  @include grid-auto(300px, 2rem);
}

// Smaller items
.thumbnail-grid {
  @include grid-auto(150px, 1rem);
}
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.thumbnail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

Live Demo (Drag to resize):

Item 1
Item 2
Item 3
Item 4
Item 5
Item 6

grid-fill() - Auto-Fill Responsive Grid

Creates a responsive grid that fills with empty columns when space is available.

Parameters:

  • $min - Minimum column width (default: 250px)
  • $gap - Gap between items (default: 1rem)
.products {
  @include grid-fill(280px, 1.5rem);
}
.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

grid-cols() - Fixed Column Grid

Creates a grid with a specific number of equal-width columns.

Parameters:

  • $cols - Number of columns (default: 12)
  • $gap - Gap between items (default: 1rem)
.dashboard {
  @include grid-cols(4, 1.5rem);
}

.three-column {
  @include grid-cols(3, 2rem);
}
.dashboard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.three-column {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

Live Demo:

Col 1
Col 2
Col 3
Col 4

grid-center() - Centered Grid Content

Centers content both horizontally and vertically within a grid cell.

.hero {
  @include grid-center;
  min-height: 400px;
}
.hero {
  display: grid;
  place-items: center;
  min-height: 400px;
}

Live Demo:

Perfectly Centered

grid-span() - Grid Item Span

Makes a grid item span across multiple columns and/or rows.

Parameters:

  • $col-span - Number of columns to span (default: 1)
  • $row-span - Number of rows to span (default: 1)
.featured {
  @include grid-span(2, 1); // Span 2 columns
}

.hero-banner {
  @include grid-span(3, 2); // Span 3 columns and 2 rows
}
.featured {
  grid-column: span 2;
  grid-row: span 1;
}

.hero-banner {
  grid-column: span 3;
  grid-row: span 2;
}

Live Demo:

Spans 2 Columns
Normal
Normal
Normal
Normal
Normal
Normal

grid-sidebar() - Sidebar Layout

Creates a sidebar + main content layout.

Parameters:

  • $sidebar-width - Width of sidebar (default: 300px)
  • $gap - Gap between sidebar and content (default: 1rem)
  • $position - left or right (default: left)
.layout {
  @include grid-sidebar(250px, 2rem, left);
}

.layout-right {
  @include grid-sidebar(300px, 1.5rem, right);
}
.layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 2rem;
}

.layout-right {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
}

Live Demo (Drag to resize):

Sidebar
Main Content

grid-holy-grail() - Holy Grail Layout

Classic header/sidebar/content/footer layout pattern.

Parameters:

  • $sidebar-width - Width of sidebars (default: 250px)
  • $gap - Gap between areas (default: 1rem)
.page {
  @include grid-holy-grail(200px, 1rem);
}
.page {
  display: grid;
  grid-template-columns: 200px 1fr 200px;
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "header header header"
    "sidebar-left content sidebar-right"
    "footer footer footer";
  gap: 1rem;
  min-height: 100vh;
}

Live Demo:

Header
Left Sidebar
Main Content
Right Sidebar
Footer

grid-cards() - Card Grid

Responsive card grid with min/max sizes for optimal card layouts.

Parameters:

  • $min - Minimum card width (default: 280px)
  • $max - Maximum card width (default: 1fr)
  • $gap - Gap between cards (default: 1.5rem)
.products {
  @include grid-cards(300px, 1fr, 2rem);
}
.products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 2rem;
}

grid-masonry() - Masonry Layout

Creates a masonry-style grid layout effect.

Parameters:

  • $cols - Number of columns (default: 3)
  • $gap - Gap between items (default: 1rem)
.pinterest {
  @include grid-masonry(4, 1rem);
}
.pinterest {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 10px;
  gap: 1rem;
}

Quick Reference

Mixin Purpose Example
grid-auto() Auto-fit responsive @include grid-auto(300px)
grid-fill() Auto-fill responsive @include grid-fill(250px)
grid-cols() Fixed columns @include grid-cols(4)
grid-center() Center content @include grid-center
grid-span() Span columns/rows @include grid-span(2, 1)
grid-sidebar() Sidebar layout @include grid-sidebar(300px)
grid-holy-grail() Holy Grail layout @include grid-holy-grail(250px)
grid-cards() Card grid @include grid-cards(280px)

CSS Utility Classes

Ready-to-use utility classes for rapid responsive development without SCSS compilation.

Auto-Fit Responsive Grids

Automatically fits columns based on available space.

Class Min Width Description
.grid-auto-sm 150px Small items
.grid-auto 250px Default size
.grid-auto-md 250px Medium items
.grid-auto-lg 350px Large items
<div class="grid-auto gap-lg">
  <div>Item 1</div>
  <div>Item 2</div>
  <div>Item 3</div>
</div>
.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

Live Demo:

1
2
3
4
5
6

Fixed Column Grids

Create grids with a specific number of equal-width columns.

.grid-cols-1
.grid-cols-2
.grid-cols-3
.grid-cols-4
.grid-cols-5
.grid-cols-6
.grid-cols-8
.grid-cols-12
<div class="grid-cols-3 gap-md">
  <div>Column 1</div>
  <div>Column 2</div>
  <div>Column 3</div>
</div>
.grid-cols-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

Live Demo:

Col 1
Col 2
Col 3

Grid Gaps

Control spacing between grid items.

.gap-0
0
.gap-xs
0.5rem
.gap-sm
1rem
.gap-md
1.5rem
.gap-lg
2rem
.gap-xl
3rem

Also available: .gap-x-* and .gap-y-* for horizontal and vertical gaps.

Grid Item Spans

Make items span across multiple columns or rows.

Column Spans

.col-span-1 .col-span-2 .col-span-3 .col-span-4 .col-span-5 .col-span-6 .col-span-full

Row Spans

.row-span-1 .row-span-2 .row-span-3 .row-span-4 .row-span-full
<div class="grid-cols-4 gap-md">
  <div class="col-span-2">Spans 2 columns</div>
  <div>Normal</div>
  <div>Normal</div>
</div>
.col-span-2 {
  grid-column: span 2;
}

.col-span-full {
  grid-column: 1 / -1;
}

Live Demo:

Spans 2
1
1
Full Width

Pre-built Layout Patterns

Common layout patterns ready to use.

Sidebar Layouts

.grid-sidebar
Left sidebar (300px)
.grid-sidebar-sm
Small sidebar (200px)
.grid-sidebar-right
Right sidebar (300px)
.grid-sidebar-sm-right
Small right sidebar (200px)
Live Demo:
Sidebar
Main Content Area

Holy Grail Layout

.grid-holy-grail
Classic header/sidebar/content/footer pattern
<div class="grid-holy-grail">
                                  <header class="grid-area-header">Header</header>
                                  <aside class="grid-area-sidebar-left">Left Sidebar</aside>
                                  <main class="grid-area-content">Main Content</main>
                                  <aside class="grid-area-sidebar-right">Right Sidebar</aside>
                                  <footer class="grid-area-footer">Footer</footer>
                                </div>
.grid-holy-grail {
                                  display: grid;
                                  grid-template-columns: 250px 1fr 250px;
                                  grid-template-rows: auto 1fr auto;
                                  grid-template-areas:
                                    "header header header"
                                    "sidebar-left content sidebar-right"
                                    "footer footer footer";
                                  gap: 1rem;
                                  min-height: 100vh;
                                }
Live Demo:
Header
Left
Content
Right

Card Grids

.grid-cards
Default cards (280px min)
.grid-cards-sm
Small cards (200px min)
.grid-cards-lg
Large cards (350px min)

Center Content

.grid-center
Perfect centering for any content
Live Demo:
Perfectly Centered

Grid Alignment Classes

Control the alignment of grid items and content.

Justify Items

.justify-items-start .justify-items-center .justify-items-end .justify-items-stretch

Align Items

.align-items-start .align-items-center .align-items-end .align-items-stretch

Place Items

.place-items-center .place-items-start .place-items-end

Place Content

.place-content-center .place-content-start .place-content-end

Real-World Examples

Responsive Image Gallery

A fully responsive gallery that adapts to any screen size.

Live Demo (Drag to resize):

Image 1
Image 2
Image 3
Image 4
Image 5
Image 6

E-commerce Product Grid

Product cards with featured items spanning multiple columns.

<div class="products">
                                  <div class="product featured">Featured Product</div>
                                  <div class="product">Product 2</div>
                                  <div class="product">Product 3</div>
                                  <div class="product">Product 4</div>
                                  <div class="product">Product 5</div>
                                </div>
.products {
                                  @include grid-auto(300px, 2rem);
                                  
                                  .featured {
                                    @include grid-span(2, 1);
                                  }
                                }
.products {
                                  display: grid;
                                  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
                                  gap: 2rem;
                                }
                                
                                .products .featured {
                                  grid-column: span 2;
                                  grid-row: span 1;
                                }

Live Demo (Drag to resize):

Featured Product
Product 2
Product 3
Product 4
Product 5

Dashboard Layout

Complex dashboard with sidebar navigation and widget grid.

<div class="dashboard">
                                  <aside class="sidebar">Navigation</aside>
                                  <main class="main">
                                    <div class="widgets">
                                      <div class="widget large">Analytics</div>
                                      <div class="widget">Users</div>
                                      <div class="widget">Revenue</div>
                                      <div class="widget">Orders</div>
                                    </div>
                                  </main>
                                </div>
.dashboard {
                                  @include grid-sidebar(250px, 2rem, left);
                                  min-height: 100vh;
                                }
                                
                                .widgets {
                                  @include grid-cols(3, 1.5rem);
                                  
                                  .large {
                                    @include grid-span(2, 1);
                                  }
                                }
.dashboard {
                                  display: grid;
                                  grid-template-columns: 250px 1fr;
                                  gap: 2rem;
                                  min-height: 100vh;
                                }
                                
                                .widgets {
                                  display: grid;
                                  grid-template-columns: repeat(3, 1fr);
                                  gap: 1.5rem;
                                }
                                
                                .widgets .large {
                                  grid-column: span 2;
                                  grid-row: span 1;
                                }

Live Demo:

Sidebar Navigation
Analytics
Users
Revenue
Orders
Stats

Blog Post Grid

Magazine-style blog layout with featured posts.

<div class="blog-grid">
                                  <article class="post featured">Featured Article</article>
                                  <article class="post">Post 2</article>
                                  <article class="post">Post 3</article>
                                  <article class="post">Post 4</article>
                                  <article class="post">Post 5</article>
                                </div>
.blog-grid {
                                  @include grid-cols(3, 2rem);
                                  
                                  .featured {
                                    @include grid-span(3, 1);
                                  }
                                }
.blog-grid {
                                  display: grid;
                                  grid-template-columns: repeat(3, 1fr);
                                  gap: 2rem;
                                }
                                
                                .blog-grid .featured {
                                  grid-column: span 3;
                                  grid-row: span 1;
                                }

Live Demo (Drag to resize):

Featured Article
Post 2
Post 3
Post 4

Changelog

Track updates, improvements, and new features introduced in Mastors Gridder.

v1.0.0 — Initial Stable Release

Latest

Frequently Asked Questions

Common questions about using Mastors Gridder in real projects.

What is Mastors Gridder?

Mastors Gridder is a modern CSS & SCSS grid utility that helps you build responsive, flexible, and production-ready layouts using CSS Grid.

Do I need SCSS to use Gridder?

No. You can use the precompiled CSS via CDN. SCSS is optional but recommended if you want customization and mixins.

Is it mobile-first?

Yes. Mastors Gridder follows a mobile-first approach and scales naturally across breakpoints.

Does it support complex layouts?

Absolutely. It supports subgrid, dense packing, masonry-style layouts, and classic patterns like holy grail and sidebars.

Is Mastors Gridder lightweight?

Yes. It’s designed to be minimal, utility-focused, and free from unnecessary bloat.

Is it open-source?

Yes. Mastors Gridder is fully open-source and maintained on GitHub. Contributions and feedback are welcome.

Browser Support

Chrome
Last 2 versions
Firefox
Last 2 versions
Safari
Last 2 versions
Edge
Last 2 versions
Opera
Last 2 versions

Full CSS Grid Support Required

Mastors Gridder uses modern CSS Grid features. All major browsers released after 2017 are fully supported.