<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Gert Pellens on Medium]]></title>
        <description><![CDATA[Stories by Gert Pellens on Medium]]></description>
        <link>https://medium.com/@gpellens?source=rss-4db6a19de6ff------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Xds5EN3sHsOqukuL.jpeg</url>
            <title>Stories by Gert Pellens on Medium</title>
            <link>https://medium.com/@gpellens?source=rss-4db6a19de6ff------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 22:09:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gpellens/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Sass (Compass) grid]]></title>
            <link>https://medium.com/@gpellens/sass-compass-grid-ea95baf600a4?source=rss-4db6a19de6ff------2</link>
            <guid isPermaLink="false">https://medium.com/p/ea95baf600a4</guid>
            <category><![CDATA[sass]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[compass]]></category>
            <category><![CDATA[grid]]></category>
            <dc:creator><![CDATA[Gert Pellens]]></dc:creator>
            <pubDate>Fri, 01 Jul 2016 13:49:09 GMT</pubDate>
            <atom:updated>2016-07-04T08:34:01.266Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aKf7GNYGdqVjAwNl2GB4dA.png" /></figure><p>Lot’s of grid layouts out there, but none that would truly satisfy my needs… I worked a long time with <a href="http://lesscss.org/">LessCSS</a>, but I switched over to Sass — Compass to be precise. So now that <a href="http://getbootstrap.com/">Bootstrap 4</a> is here (based on Sass), I thought it was time to share my grid system.</p><blockquote>Every client or project has it’s own requirements. This grid system is created to be as customisable as possible — just by changing some variables.</blockquote><p>You can <a href="https://github.com/pellens/Sass-grid">download the project and example files</a> from Github.</p><h4>Defining the viewports</h4><p>Before starting my projects, I need to know what the desired <strong>viewports</strong> are. It can vary from client to client, so I wanted to make this as customisable as possible… In this example, I have <strong>5 viewports that need custom behaviour</strong>:</p><ul><li>(Standard): +960px</li><li>Desktop: 960px</li><li>Tablet: 800px</li><li>Phablet: 600px</li><li>Mobile: 400px</li></ul><p>So in my Sass file, I define the names I choose for the viewports and a ‘array’ with the related widths.</p><pre>$viewports_width : ‘960px’, ‘800px’, ‘600px’, ‘400px’;<br>$viewports_title : ‘desktop’, ‘tablet’, ‘phablet’, ‘mobile’;</pre><h4>The gutter and max-width</h4><p>[image of gutter / max-width example here]</p><p>So, the designer created delicious screens for you to slice up. But one designer works in 960px width artboard, while others go to 1400px or further… It should be easy to define this in our Sass file!</p><pre>$max_width   : 1200px;<br>$grid_gutter : 2%;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hCYrg2xjMViAxl8TFGMSpg.png" /></figure><h4>12 column based grid</h4><p><em>Ye ol’ 12 col grid</em>. The 12 column grid, based upon the <a href="http://960.gs/">960 grid</a>, which opened my eyes for clean web development in the early days! So let’s create this the Sass-way!</p><p><strong>The HTML structure example we will apply:</strong></p><pre>&lt;div class=&quot;row&quot;&gt;<br>    &lt;div class=&quot;col-6&quot;&gt;I&#39;m 6 columns wide&lt;/div&gt;<br>    &lt;div class=&quot;col-3&quot;&gt;I&#39;m 3 columns wide&lt;/div&gt;<br>    &lt;div class=&quot;col-3&quot;&gt;I&#39;m 3 columns wide&lt;/div&gt;<br>&lt;/div&gt;</pre><h4>Percentage based grid</h4><p>Maybe, we don’t want the gutter in our grid, but have really custom measurements. We can still provide a percentage based system, not based on columns but purely on widths. I find this very useful in more complex page compositions.</p><p><strong>The HTML structure example we will apply:</strong></p><pre>// The HTML structure example we will apply</pre><pre>&lt;div class=&quot;row&quot;&gt;<br>    &lt;div class=&quot;grid-50&quot;&gt;I&#39;m 50% wide&lt;/div&gt;<br>    &lt;div class=&quot;grid-25&quot;&gt;I&#39;m 25% wide&lt;/div&gt;<br>    &lt;div class=&quot;grid-25&quot;&gt;I&#39;m 25% wide&lt;/div&gt;<br>&lt;/div&gt;</pre><h4>Mix it up</h4><p>So we are able to use columns (col-1 until col-12) and work purely with percentages (grid-1 until grid-100). We combine them to create very precise layouts.</p><p><strong>The HTML structure example we can apply:</strong></p><pre>&lt;div class=&quot;row&quot;&gt;<br>    &lt;div class=&quot;col-12&quot;&gt;<br>        &lt;div class=&quot;grid-50&quot;&gt;I&#39;m 50% wide&lt;/div&gt;<br>        &lt;div class=&quot;grid-25&quot;&gt;I&#39;m 25% wide&lt;/div&gt;<br>        &lt;div class=&quot;grid-25&quot;&gt;I&#39;m 25% wide&lt;/div&gt;<br>    &lt;/div&gt;<br>&lt;/div&gt;</pre><h4>The Sass file</h4><p>You can take a look at the <a href="https://gist.github.com/pellens/799434e3fa3e090b48a01c5ff8959f74">Gist of the Sass file</a>. It compiles to a 16.1 KB css file, or can be included into your custom Sass files.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c1570a11229064c67f2ecc90edcd75b0/href">https://medium.com/media/c1570a11229064c67f2ecc90edcd75b0/href</a></iframe><p>You can <a href="https://github.com/pellens/Sass-grid">download the project and example files</a> from Github. Enjoy!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ea95baf600a4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>