Using Jeet’s Fluid Column Gutter Mixin for Responsive Sass Layouts
Learn how Jeet’s @include column() mixin creates proportion‑based columns with automatic, viewport‑scaled gutters, and see a concrete example you can verify in your own project.
21 Oct 2025, 20:44 UTC

The problem: fixed gutters break responsive proportions
When building a responsive layout with Sass, you often want columns that keep a fixed ratio (e.g., three equal columns) while the space between them scales with the viewport. Writing manual percentages for width and margin leads to repetitive math and makes it hard to adjust the gutter later.
Thesis: Jeet’s @include column() mixin solves this by calculating width and fluid gutter from a single fraction
Jeet provides a Sass mixin that turns a simple fraction like 1/3 into a percentage width and, when the gutter argument is true (or omitted), adds a left‑ or right‑margin equal to a configurable gutter percentage. The result is a column set that grows and shrinks together with its parent container, without any fixed pixel values.
How the mixin works
@include column($span, $gutter: true)–$spanis a fraction (e.g.,1/3or2/5). The mixin computeswidth: $span * 100%.- If
$gutteris truthy, it adds a margin‑left (or margin‑right in RTL) equal to$jeet-gutter * 100%, where$jeet-gutterdefaults to0.1(10%). - An optional
$offsetargument pushes the column by multiples of the gutter‑plus‑column width, enabling complex layouts while keeping markup semantic.
Worked example: three‑column layout with a 10% fluid gutter
Follow these steps to see the mixin in action. All commands assume a Unix‑like shell and normal user privileges.
- Create a fresh project folder and initialize npm:
- Install Jeet and Sass:
- Create
styles.scsswith the following content: - Compile the Sass to CSS:
- Inspect the generated CSS (you can open
styles.cssin an editor): - Create a simple HTML file to test:
- Open the HTML in a browser and resize the window. The three columns should keep their 33.33% width and the 3.33% left margin, demonstrating a fluid gutter that scales with the container.
mkdir jeet-demo && cd jeet-demo
npm init -y
npm install jeet sass --save-dev
@import 'jeet';
$jeet-gutter: 0.1; /* 10% gutter */
.container {
width: 90%;
margin: 0 auto;
background: #fafafa;
padding: 1rem;
}
.item {
background: #e0f7fa;
padding: 1rem;
box-sizing: border-box;
}
/* Three equal columns */
.item {
@include column(1/3);
}
npx sass styles.scss styles.css
.item {
width: 33.33333%;
margin-left: 3.33333%; /* 10% gutter of the parent */
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Jeet demo</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="container">
<div class="item">1</div>
<div class="item">2</div>
<div class="item">3</div>
</div>
</body>
</html>
Verification checklist
- Each
.itemhaswidth: 33.33333%. - Each
.itemhasmargin-left: 3.33333%(ormargin-rightif the page direction is RTL). - Changing the browser width or the container’s width does not break the column ratio or gutter proportion.
Trade‑off and limitation
Jeet’s grid is built on percentage widths and margins, which means it does not natively interoperate with CSS Grid or Flexbox containers. If you place a Jeet column inside a flex parent, the flex item’s flex-basis may conflict with the percentage width, leading to unexpected spacing. To avoid this, keep Jeet columns within containers that use the normal block flow, or wrap them in an extra div that resets flex behavior.
Another consideration is the build step: Jeet requires Sass (or SCSS) preprocessing. Projects that rely solely on plain CSS must add a Sass compiler to their toolchain, which introduces a minor setup overhead.
Actionable closing
If you need a lightweight, semantic grid that scales gutters with the viewport without writing repetitive math, Jeet’s @include column() mixin is a practical choice. Start by defining a gutter percentage, apply the mixin to your column elements, and verify the output with the steps above. Remember to keep Jeet columns in block‑flow containers to avoid conflicts with Flexbox or Grid layouts, and you’ll have a responsive layout that adapts fluidly to any screen size.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.