MotivationInstallDocsCustomize
MotivationInstallDocsCustomize
  • Overview
  • Important! Purge!
  • Getting Started
    • Colors and Pseudo Classes
      • Colors
        • Color Shades

        • Psuedo Classes

      • Classes with Colors
        • Text Color

        • Background Color

        • Border Color

        • Outline Color

        • Text Decoration

        • Selection

      • Transitions
        • Transition Classes

        • With Pseudo Classes

      • Additional Classes
        • Font Size

        • Font Family

        • Font Weight

        • Text Decoration & Style

        • Border Width & Style

        • Outline Width & Style

    • Dark Mode
      • With JS

      • No JS

      • Grid
        • Class Definitions

        • Responsive Examples

        • Responsive Examples
          • Breakpoints

          • Max Breakpoints

          • Examples

          • Margin
            • Classes

            • Examples

          • Padding
            • Classes

            • Examples

          • Border Width
            • Classes

            • Examples

          • Outline Width
            • Classes

            • Outline Offset

            • Examples

          • Width
            • Rem Values

            • Percantage Values

            • Screen relative Values

            • XS - XL

          • Height
            • Rem Values

            • Percantage Values

            • Screen relative Values

            • XS - XL

          • Display
          • Flex
            • Flex Direction

            • Flex Wrap

            • Shrink & Grow

            • Justify Content

            • Align Content

            • Align Items

            • Align Self

            • Not Included

          • Text/Font
            • Font Size

            • Line Height

            • Letter Spacing

          • Position
            • Top Left Right & Bottom

          • Overflow
            • Overflow x & y

          • Box Sizing
        • Box-Shadow
          • Size

          • Color

          • Respoinsive

          • Psuedo States

          • Other Utilities
            • Text/Font
              • Align

              • Transform

              • Indent

              • Wrap

              • Font Family

              • Font Weight

              • Font Style

              • Text Decoration

              • Decoration Thickness

            • Border
              • Directional Style

            • Outline Style
            • Cursor
            • Opacity
            • Visibility
            • z-Index

          Simple Scss Utilities


          The Grid System

          How to Use the Grid

          Not to be confused with CSS-grid, I personally perfer to do as much as I can with flexbox, but a col-based grid system is pretty simple to make and still comes in handy so one is included. I actually didn't includ css-grid in this framework, one because I never really use it much myself, but also because it doesn't really make sense to handle the complexity and unique use cases with a framework which to me seems more cumbersome than writing it yourself!

          However, I do have a this greatly simplified col-based grid system, which I think is useful enough for a lot of use cases!

          It's a pretty standard 12 column system and the column classes .col-1, .col-2, etc determine how many columns an element takes up in the container. The classes are definately made to be responsive, so if you're on a browser try changing the screen widths to see how elements react!

          So to use these classes wrap them in a row class, which pretty much applies a display flex, and there's gap classes for column gaps which supplies padding to the direct children, as well as negitive margins to the row. Like everything else, the column gap values can be modified in _varialbes.css (see Customize section for more details). Here's a listing of all the grid classes, and see below for a few examples:

          Class Definitions

          (note: gap classes are applied to the children of the row)

          ClassCSS rule
          .rowdisplay: flex;: 
          ;
          display: flex;: 
          ;
          .gap-nonepadding: 0
          .gap-xspadding: .25rem
          .gap-smpadding: .5rem
          .gap-mdpadding: 1rem
          .gap-lgpadding: 1.5rem
          .gap-xlpadding: 2rem
          .gap-2xlpadding: 3rem
          .col-1box-sizing: border-box;: 
          ;
          box-sizing: border-box;: 
          ;
          box-sizing: border-box;: 
          ;
          .col-2box-sizing: border-box;: 
          ;
          box-sizing: border-box;: 
          ;
          box-sizing: border-box;: 
          ;
          .col-3box-sizing: border-box;: 
          ;
          box-sizing: border-box;: 
          ;
          box-sizing: border-box;: 
          ;
          .col-4box-sizing: border-box;: 
          ;
          box-sizing: border-box;: 
          ;
          box-sizing: border-box;: 
          ;
          .col-5box-sizing: border-box;: 
          ;
          box-sizing: border-box;: 
          ;
          box-sizing: border-box;: 
          ;
          .col-6box-sizing: border-box;: 
          ;
          box-sizing: border-box;: 
          ;
          box-sizing: border-box;: 
          ;
          .col-7box-sizing: border-box;: 
          ;
          box-sizing: border-box;: 
          ;
          box-sizing: border-box;: 
          ;
          .col-8box-sizing: border-box;: 
          ;
          box-sizing: border-box;: 
          ;
          box-sizing: border-box;: 
          ;
          .col-9box-sizing: border-box;: 
          ;
          box-sizing: border-box;: 
          ;
          box-sizing: border-box;: 
          ;
          .col-10box-sizing: border-box;: 
          ;
          box-sizing: border-box;: 
          ;
          box-sizing: border-box;: 
          ;
          .col-11box-sizing: border-box;: 
          ;
          box-sizing: border-box;: 
          ;
          box-sizing: border-box;: 
          ;
          .col-12box-sizing: border-box;: 
          ;
          box-sizing: border-box;: 
          ;
          box-sizing: border-box;: 
          ;

          Responsive Examples

          Here is a simple example that's not responsive, but just fills the screen width.

          Medium gap, 4 cols (each column take up 3 "column slots" out of 12, making each a quarter width):

          .col-3

          .col-3

          .col-3

          .col-3

          Html
          <!-- row container and gap -->
          <div className="row h-8 gap-md">
          <!-- each child div is 3 container widths out of 12, or 1/4 width total -->
          <div className="col-3 br-sm border-dotted">
          <!-- the gap-md class on the row provides a consistant inner padding -->
          <div className="bg-blue center h-full radius-md">
          <p className="text-white">col-3</p>
          </div>
          </div>
          <div className="col-3 br-sm border-dotted">
          <div className="bg-blue center h-full radius-md">
          <p className="text-white">col-3</p>
          </div>
          </div>
          <div className="col-3 br-sm border-dotted">
          <div className="bg-blue center h-full radius-md">
          <p className="text-white">col-3</p>
          </div>
          </div>
          <div className="col-3">
          <div className="bg-blue center h-full radius-md">
          <p className="text-white">col-3</p>
          </div>
          </div>
          </div>

          Now let's take a look at an example that changes from large screens to mobile according to the default breakpoints. If you change the screen width, you might have to get the sidebar out of the way on 768px or smaller (the default "tablet" or "tab" break point). The additional classes make it a bit more complitcated, but not too much more. Notice that in this case it's also best to switch the height classes to the inner grid items themselves.

          col-12

          .lg:col-3

          .scr:col-6

          col-12

          .lg:col-3

          .scr:col-6

          col-12

          .lg:col-3

          .scr:col-6

          col-12

          .lg:col-3

          .scr:col-6

          I switched the gap class to be a bit smaller and element has a default width of 12, but on screen sizes (denoted by the scr: prefix) which by default is anything over 768px wide, the width becomes 6 for a 2 column layout, and on large sizes (denoted by the lg: prefix), the width becomes 3 for a 4 column layout.

          Also, note that this is only one way of using the responsive classes. For more info on how they work see the Responsive section.

          And as a final note: the center class has a display of flex built in, so all I need is a flex-col class to get inner text paragraphs in a column, and the HTML is as follows.

          Html
          <div className="row gap-sm">
          <div className="h-8 col-12 lg:col-3 scr:col-6 scr:br-sm border-dotted">
          <div className="bg-blue text-white center flex-col h-full radius-md">
          <p>.col-12</p>
          <p>.scr:col-6</p>
          <p>.lg:col-3</p>
          </div>
          </div>
          <div className="h-8 col-12 lg:col-3 scr:col-6 lg:br-sm border-dotted">
          <div className="bg-blue text-white center flex-col h-full radius-md">
          <p>.col-12</p>
          <p>.scr:col-6</p>
          <p>.lg:col-3</p>
          </div>
          </div>
          <div className="h-8 col-12 lg:col-3 scr:col-6 scr:br-sm border-dotted">
          <div className="bg-blue text-white center flex-col h-full radius-md">
          <p>.col-12</p>
          <p>.scr:col-6</p>
          <p>.lg:col-3</p>
          </div>
          </div>
          <div className="h-8 col-12 lg:col-3 scr:col-6">
          <div className="bg-blue text-white center flex-col h-full radius-md">
          <p>.col-12</p>
          <p>.scr:col-6</p>
          <p>.lg:col-3</p>
          </div>
          </div>
          </div>

          Hopefully this shows how easy it is to add some basic columns to a layout with these utility classes!

          © 2025 Simple Scss Utilities