cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              !!! 5
%html
  %head
    %title Responsive Dozenal Sass Grid

  %body
    %header.header.p-lg-vm
      %hgroup.container
        %h1 Responsive Dozenal Sass Grid
    
      
    /
      .header.m-xs-tl.p-lg-vm
        .container
          %h2 Table of Contents
      .container

        %ul.collapsed.m-xs-tl
          %li 
            %a{:href=>"#codepen"} The Codepen Code
          %li 
            %a{:href=>"#container"} The Container
          %li 
            %a{:href=>"#breakpoints"} The Breakpoints
          %li 
            %a{:href=>"#dozenal"} The Dozenal Grid
          %li 
            %a{:href=>"#square"} The Responsive Square
          %li 
            %a{:href=>"#mainside"} Main / Side Columns
          %li 
            %a{:href=>"#utilities"} Utility Classes
          %li 
            %a{:href=>"#closing"} Closing Thoughts
    
    
    
    %div
      .header.m-xs-tl.p-lg-vm.active#idcodepen{:'data-id'=>"idcodepen"}
        .container
          %h2 The Codepen Code
      .container
        %p Make sure you check the haml and sass from the codepen and then click the "View Compiled" buttons to see the html and css outputs from these two languages.
        %p There is a lot to cover here, so go piece by piece, and ask any questions in the codepen comments.





      .header.m-xs-tl.p-lg-vm#idcontainer{:'data-id'=>"idcontainer"}
        .container
          %h2 The Container
      .container
        %p The container is your first line of defense in a modern website for basic responsiveness. The container class is used to define a maximum width for your main site size. It should be put on a parent element around any section that should not go bigger than your chosen width.
        %p Notice that the headings are all full width color, but then have a container inside of them. While the rest of the site is all within their own containers.





      .header.m-xs-tl.p-lg-vm#idbreakpoints{:'data-id'=>"idbreakpoints"}
        .container
          %h2 The Breakpoints
      .container
        %p Throughout this library almost every class has a responsive prefix inside of it. There are five prefixes that each equal a css Media Query breakpoint.

        %table
          %thead
            %tr
              %th prefix
              %th name
              %th min-width
          %tbody
            %tr
              %td xs
              %td extra-small
              %td 0
            %tr
              %td sm
              %td small
              %td 320px
            %tr
              %td md
              %td medium
              %td 600px
            %tr
              %td lg
              %td large
              %td 960px
            %tr
              %td xl
              %td extra-large
              %td 1200px
        %p Because minimum widths are used in this library, it means that all design patterns and decisions should be made as mobile first. Breakpoint values will retain from the smallest size they are set through any higher sizes that don't override those values. What does this mean?
        %p You don't need to set class="col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12". You only need to set one value, at the smallest breakpoint, and it will carry over to the higher breakpoints. so class="col-xs-12" is sufficient to cover all breakpoints, whereas class="col-md-12" will have no value at xs and sm, but md lg and xl will all be covered. Likewise, you can skip breakpoints in the middle of relevant change breakpoints, so class="col-xs-12 col-lg-6" will have 12 for xs sm and md, and will have 6 for lg and xl.





      .header.m-xs-tl.p-lg-vm#iddozenal{:'data-id'=>"iddozenal"}
        .container
          %h2 The Dozenal Grid
      .container
        %p This is a 12 column grid library that showcases haml, and sass code as well as many examples for how to understand and use a dozenal grid.
        %p Dozenal comes from dozen, meaning 12. It means a base 12 number system. Like Decimal, which means base 10.
        %p Here is a grid with only two columns. They are not responsive, and instead will always be two 50% columns at every browser size. The first time a designer meets a grid library it can be difficult to understand how to interperet the classes. XS in this case indicates "starting from the Extra Small Media Query" and 6 indicates "Covers 6 of the twelve columns available". So this would mean starting at xs size, this covers 50% of a 12 column grid.
        %p Try changing the size of your browser to see the difference in any of these examples  (or rotate your device). And if you're on mobile, there should be little 1x 0.5x 0.25x buttons to allow you to see different sizes. This first example will have no difference. most of the others will.
        .grid.lined
          .row.gutters
            .col-xs-6
              .well First
            .col-xs-6
              .well Second

        %p This next grid has 12 segments that have many Media Query breakpoints that allow very dynamic layout changes for different sizes of browser. Notice that they are written in order of the Media Query breakpoints so that they can be easily understood by a human, but the order of assignment is irrelevant.
        %p Notice that each Media Query breakpoint is covered in this example, but this is totally unnecessary. This grid is mobile first, which means that if as long as you use a XS breakpoint, until another breakpoint issues a different value, all breakpoints will share the first's value. You can even see that the breakpoints don't follow a completely linear change in columns covered, since LG in this example covers a 4 columns (a third) and MD covers 3 columns (a fourth)
        %p Notice also that if you intend to have many different elements sometimes on one line, sometimes on many lines, you don't need to, and probably shouldn't, put a row around each possible visible row. Elements will naturally flow to new visible rows when the space limitations demand it.
        .grid.lined
          .row.gutters
            - (1..12).each do |i|
              .col-xs-12.col-sm-6.col-md-3.col-lg-4.col-xl-1
                .well #{i}

        %p Here is a grid without gutters. It is important to understand that a grid should always be used for structure and rarely altered for design. We use a simple well class to give a bit of differentiation between our columns. But these wells are placed inside of the columns, not attached to them.
        .grid.lined
          .row
            - (1..6).each do |i|
              .col-xs-12.col-md-6.col-lg-2
                .well #{i}

        %p Here are some more examples. Just check the code. The column count for each breakpoint should always add up to 12.
        .grid.lined
          .row.gutters
            .col-xs-12.col-sm-4.col-md-3.col-lg-5.col-xl-2
              .well 1
            .col-xs-12.col-sm-4.col-md-6.col-lg-2.col-xl-4
              .well 2
            .col-xs-12.col-sm-4.col-md-3.col-lg-5.col-xl-6
              .well 3

        %p Offsets are available in this library. Offsets allow you to push an element over on the left based on column sizes. Just remember to always have your numbers add up to 12, including both columns and offsets.
        .grid.m-xs-tm.lined
          .row.gutters
            .col-xs-12.col-md-6.col-lg-2
              .well 1
            .col-xs-12.col-md-6.col-lg-2.offset-lg-3
              .well 2
            .col-xs-12.col-lg-2.offset-lg-3
              .well 3

        %p Grids have a percentage of a parent's size, even if the parent is another column.
        .grid.m-xs-tm.lined
          .row
            .col-xs-12.col-md-6
              .well
                .well 1
                .grid.lined
                  .row.gutters
                    .col-xs-12.col-md-6
                      .well 1
                    .col-xs-12.col-md-6
                      .well 2
            .col-xs-12.col-md-6
              .well
                .well 2
                .grid.lined
                  .row.gutters
                    .col-xs-12.col-md-4
                      .well 1
                    .col-xs-12.col-md-4
                      .well 2
                    .col-xs-12.col-md-4
                      .well 3




      .header.m-xs-tl.p-lg-vm#idsquare{:'data-id'=>"idsquare"}
        .container
          %h2 The Responsive Square
      .container
        %p This example shows a couple tricky tricks to do a couple tricky things.
        %ol
          %li The first element inside the responsive column (.square-parent) is set to a responsive square.
          %li The next element (.square-child) uses a simple css class to make a child fill it's parent and immediately give height to the weird non-height trick we just pulled. It also sets this element to position absolute, and a well for visual.
          %li The final element (.centered-child) uses a css trick to make a child centered horizontally and vertically in a parent, as long as that parent has height. Notice the lorem text does not have specified height or width. Change the text, add breaks, it will still be centered.
        .grid.m-xs-tm.lined
          .row.gutters
            - (1..6).each do |i|
              .col-xs-12.col-sm-6.col-md-4.col-xl-2
                .square-parent
                  .square-child.well
                    .centered-child lorem




      .header.m-xs-tl.p-lg-vm#idmainside{:'data-id'=>"idmainside"}
        .container
          %h2 Main / Side columns
      .container
        %p Here we have a series of main section / side section grids just for fun, but also for common website layout. The side columns have a fixed width of 200 pixels, while the main columns relatively take up the rest of the space available, using the css calc function. Since the calc function is css, and not sass, make sure you hash brace any sass variables into the calc function to flatten them.
        .grid.lined
          .row.gutters
            .col-xs-12.col-md-side
              .well
                %ul.collapsed
                  %li Side Section
                  %li Link 1
                  %li Link 2
                  %li Link 3
            .col-xs-12.col-md-main
              .well
                %p.m-xs-n This is a main section with one side section on the left.

        %p Maybe this one will give you a better idea how this all might actually work. Also there are two side columns in this one. Columns with different heights definitely work better when there is one background color (or none) instead of individual background colors.
        .grid.m-xs-tm.well.lined
          .row.gutters
            .col-xs-12.col-md-side
              %ul.collapsed
                %li Side Section
                %li Link 1
                %li Link 2
                %li Link 3
            .col-xs-12.col-md-main2
              %p.m-xs-n This is a main section with two side sections. Notice that the class has changed to .col-md-main2, instead of just .col-md-main.
              %p Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris consectetur sodales mollis. Vestibulum tincidunt, urna non blandit suscipit, lacus nunc laoreet massa, quis elementum ex ex sit amet lacus. Donec dui lorem, tempor id dictum a, mattis nec ipsum. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; In nec vestibulum felis, non aliquam leo. In eget nisi rhoncus, auctor elit in, interdum purus. Donec eros magna, pellentesque ut lorem sit amet, laoreet rutrum leo. Nullam ultrices dapibus felis.
              %p Sed efficitur, dolor sit amet porttitor varius, mi quam vehicula nisi, eget accumsan libero lacus eu augue. Donec faucibus quis turpis ac pellentesque. Suspendisse dignissim porta arcu, ac consectetur nisl hendrerit et. In in dolor sollicitudin, posuere arcu sed, gravida dui. Aenean posuere odio sit amet magna semper sodales. Nam eu nunc porttitor, congue felis ac, porta orci. Pellentesque nisi nisi, egestas at ullamcorper bibendum, feugiat vitae nibh. Vestibulum convallis commodo orci quis euismod. Donec nisl nisi, ullamcorper vitae porttitor eget, volutpat eget ante.
            .col-xs-12.col-md-side
              %ul.collapsed
                %li Side Section
                %li Link 1
                %li Link 2
                %li Link 3

        %p The outer grid here has gutters, but the inner does not.
        .grid.m-xs-tm.lined
          .row.gutters
            .col-xs-12.col-md-main
              .well
                %p.m-xs-n
                  This is a main section with one side section on the right. Grids can go inside of other grids, and each sub grid receives a percentage of the parent element.
                .grid.m-xs-tm.lined
                  .row
                    .col-xs-12.col-sm-6
                      .well content
                    .col-xs-12.col-sm-6
                      .well content
            .col-xs-12.col-md-side
              .well
                %ul.collapsed
                  %li Side Section
                  %li Link 1
                  %li Link 2
                  %li Link 3




      .header.m-xs-tl.p-lg-vm#idutilities{:'data-id'=>"idutilities"}
        .container
          %h2 Utility Classes
      .container
        %p Get ready for examples galore of all the utility classes that this library has available. Also notice that you can easily add your own. These classes are great for starting a project, but should definitely be streamlined into custom classes later. All of these classes are potentially responsive.
        %p The key to understanding the utility classes is seeing the patterns, and then understanding that they all work the exact same way.

        %h3 Box Model
        %p Both padding and margin use the same values. A direction, followed by a size.

        %h4 Direction
        %ul
          %li t: top
          %li r: right
          %li b: bottom
          %li l: left
          %li v: vertical
          %li h: horizontal
        %h4 Size
        %ul
          %li l: 20px
          %li m: 10px
          %li s: 5px
          %li n: 0 (this one is mostly for responsive removal)

        %h4 Padding (with large distance)

        .lined.display-ib
          .swell.p-xs-tl .p-xs-tl
        .lined.display-ib
          .swell.p-xs-rl .p-xs-rl
        .lined.display-ib
          .swell.p-xs-bl .p-xs-bl
        .lined.display-ib
          .swell.p-xs-ll .p-xs-ll
        .lined.display-ib
          .swell.p-xs-vl .p-xs-vl
        .lined.display-ib
          .swell.p-xs-hl .p-xs-hl
        .lined.display-ib
          .swell.p-xs-l .p-xs-l
        .lined.display-ib
          .swell.p-xs-n .p-xs-n

        %h4 Margin (with medium distance)

        .lined.display-ib
          .swell.m-xs-tm .m-xs-tm
        .lined.display-ib
          .swell.m-xs-rm .m-xs-rm
        .lined.display-ib
          .swell.m-xs-bm .m-xs-bm
        .lined.display-ib
          .swell.m-xs-lm .m-xs-lm
        .lined.display-ib
          .swell.m-xs-vm .m-xs-vm
        .lined.display-ib
          .swell.m-xs-hm .m-xs-hm
        .lined.display-ib
          .swell.m-xs-m .m-xs-m
        .lined.display-ib
          .swell.m-xs-n .m-xs-n

        %h3 Alignment

        %p I decided to use the same class prefix for vertical and horizontal alignment.

        %h4 Horizontal
        %ul
          %li l: Left
          %li c: Center
          %li r: Right
          %li j: Justify
        .grid
          .row.gutters
            .col-xs-12.col-md-3
              %strong .align-xs-l
              .align-xs-l Sed efficitur, dolor sit amet porttitor varius, mi quam vehicula nisi, eget accumsan libero lacus eu augue. Donec faucibus quis turpis ac pellentesque. Suspendisse dignissim porta arcu, ac consectetur nisl hendrerit et. In in dolor sollicitudin, posuere arcu sed, gravida dui. Aenean posuere odio sit amet magna semper sodales. Nam eu nunc porttitor, congue felis ac, porta orci.
            .col-xs-12.col-md-3
              %strong .align-xs-r
              .align-xs-r Sed efficitur, dolor sit amet porttitor varius, mi quam vehicula nisi, eget accumsan libero lacus eu augue. Donec faucibus quis turpis ac pellentesque. Suspendisse dignissim porta arcu, ac consectetur nisl hendrerit et. In in dolor sollicitudin, posuere arcu sed, gravida dui. Aenean posuere odio sit amet magna semper sodales. Nam eu nunc porttitor, congue felis ac, porta orci.
            .col-xs-12.col-md-3
              %strong .align-xs-c
              .align-xs-c Sed efficitur, dolor sit amet porttitor varius, mi quam vehicula nisi, eget accumsan libero lacus eu augue. Donec faucibus quis turpis ac pellentesque. Suspendisse dignissim porta arcu, ac consectetur nisl hendrerit et. In in dolor sollicitudin, posuere arcu sed, gravida dui. Aenean posuere odio sit amet magna semper sodales. Nam eu nunc porttitor, congue felis ac, porta orci.
            .col-xs-12.col-md-3
              %strong .align-xs-j
              .align-xs-j Sed efficitur, dolor sit amet porttitor varius, mi quam vehicula nisi, eget accumsan libero lacus eu augue. Donec faucibus quis turpis ac pellentesque. Suspendisse dignissim porta arcu, ac consectetur nisl hendrerit et. In in dolor sollicitudin, posuere arcu sed, gravida dui. Aenean posuere odio sit amet magna semper sodales. Nam eu nunc porttitor, congue felis ac, porta orci.

        %h4 Vertical
        %ul
          %li t: Top
          %li m: Middle
          %li b: Bottom
          %li bl: Baseline
        .grid
          .row.gutters
            .col-xs-12.col-md-3
              %strong .align-xs-t
              .m-xs-tm
                .display-xs-ib.lined.align-xs-t &
                .display-xs-ib.well.align-xs-t &<br>&
            .col-xs-12.col-md-3
              %strong .align-xs-m
              .m-xs-tm
                .display-xs-ib.lined.align-xs-m &
                .display-xs-ib.well.align-xs-m &<br>&
            .col-xs-12.col-md-3
              %strong .align-xs-b
              .m-xs-tm
                .display-xs-ib.lined.align-xs-b &
                .display-xs-ib.well.align-xs-b &<br>&
            .col-xs-12.col-md-3
              %strong .align-xs-bl
              .m-xs-tm
                .display-xs-ib.lined.align-xs-bl &
                .display-xs-ib.well.align-xs-bl &<br>&

        %h4 Pull Floats
        %ul
          %li left
          %li right
          %li none
          %li clear (clears both)
          %li center (this just makes left and right margins auto, and will only work on a block element that has a defined width)
        .grid
          .row.gutters
            .col-xs-12.col-md-3
              .align-xs-j
                %strong.pull-xs-left.well .pull-xs-left
                Sed efficitur, dolor sit amet porttitor varius, mi quam vehicula nisi, eget accumsan libero lacus eu augue. Donec faucibus quis turpis ac pellentesque. Suspendisse dignissim porta arcu, ac consectetur nisl hendrerit et. In in dolor sollicitudin, posuere arcu sed, gravida dui. Aenean posuere odio sit amet magna semper sodales. Nam eu nunc porttitor, congue felis ac, porta orci.
            .col-xs-12.col-md-3
              .align-xs-j
                %strong.pull-xs-right.well .pull-xs-right
                Sed efficitur, dolor sit amet porttitor varius, mi quam vehicula nisi, eget accumsan libero lacus eu augue. Donec faucibus quis turpis ac pellentesque. Suspendisse dignissim porta arcu, ac consectetur nisl hendrerit et. In in dolor sollicitudin, posuere arcu sed, gravida dui. Aenean posuere odio sit amet magna semper sodales. Nam eu nunc porttitor, congue felis ac, porta orci.
            .col-xs-12.col-md-3
              .align-xs-j
                %strong.pull-xs-none.well .pull-xs-none
                Sed efficitur, dolor sit amet porttitor varius, mi quam vehicula nisi, eget accumsan libero lacus eu augue. Donec faucibus quis turpis ac pellentesque. Suspendisse dignissim porta arcu, ac consectetur nisl hendrerit et. In in dolor sollicitudin, posuere arcu sed, gravida dui. Aenean posuere odio sit amet magna semper sodales. Nam eu nunc porttitor, congue felis ac, porta orci.
            .col-xs-12.col-md-3
              .align-xs-j
                %strong.pull-xs-left.well .pull-xs-left
                %strong.pull-xs-left.pull-xs-clear.well .pull-xs-clear
                Sed efficitur, dolor sit amet porttitor varius, mi quam vehicula nisi, eget accumsan libero lacus eu augue. Donec faucibus quis turpis ac pellentesque. Suspendisse dignissim porta arcu, ac consectetur nisl hendrerit et. In in dolor sollicitudin, posuere arcu sed, gravida dui. Aenean posuere odio sit amet magna semper sodales. Nam eu nunc porttitor, congue felis ac, porta orci.

        %h4 Display
        %p eg. .display-xs-ib
        %ul
          %li b: block
          %li ib: inline-block
          %li n: none

        %h4 Position
        %p eg. .position-xs-a
        %ul
          %li s: static
          %li r: relative
          %li a: absolute
          %li f: fixed




      .header.m-xs-tl.p-lg-vm#idclosing{:'data-id'=>"idclosing"}
        .container
          %h2 Closing Thoughts
      .container
        %ul
          %li A grid library should be used for layout. Design and content should always be placed inside columns, columns in rows, and (in this case) rows in grids.
          %li A row with only one element in it that is only col-xs-12 is not a row or a column. That's just a div. Don't use rows and grids where they are not needed.
          %li For the most part, grids can get gross and confusing. Feel free to simplify things in your html and css later, after you've gotten your design into a place that feels good. Grids are great for starting a project, but they can be intimidating to alter in the future.
          %li You can't switch the order of your columns with a simple grid library. You will have to do some much more custom code, and will probably end up using flex-box in order to get the job done.
          %li Learning how to use a css library is a great idea. Learning why things are done in css is a better idea. You know... actually learning css. It's hard. It's weird. But it's worth it.
            
          
!
            
              
$column-length: 12;
$column-gutter: 10px;
$gutter-size:1.1;
$side-column-width:180px;

$container-map: (
	xs:0,
	sm:320px,
	md:600px,
	lg:960px,
	xl:1200px
	);
$sizes-map: (
	l:20px,
	m:10px,
	s:5px,
  n:0
	);
$positions-map:(
	t:top,
	r:right,
	b:bottom,
	l:left
	);

$boxes-map: (
	p:padding,
	m:margin
	);

$alignment-ver-map: (
	t:top,
	m:middle,
	b:bottom,
  bl:baseline
	);
$alignment-hor-map: (
	l:left,
	c:center,
	r:right,
	j:justify
	);
$display-map: (
	b:block,
	ib:inline-block,
	n:none
	);
$positioning-map: (
	s:static,
	r:relative,
	a:absolute,
  f:fixed
	);



@mixin clearfix {
	content:"";
	display:table;
	clear:both;
}



* {
  box-sizing:border-box;
  transition:width 0.3s, height 0.3s;
}



/* Just design stuff, not grid */
// These couple things aren't super important to your grid system, but they help me with the examples, and make my page look pretty.
// Oh god, I keep adding more!
body {
  margin:0;
  font-family:calibri,sans-serif;
}
$main-color:#76B3A2;
.header {
  background-color:$main-color;
  h1,
  h2{
    margin:0;
    color:white;
  }
  &:not(.active)+.container {
    display:none;
  }
}
div.header {
  cursor:pointer;
  &:hover {
    background-color:lighten($main-color,10%);
  }
}
h1,
h2 {
  font-family:cambria,serif;
}
a {
  color:$main-color;
  font-weight:bold;
  text-decoration:none;
  &:hover {
    text-decoration:underline;
  }
}
.collapsed {
  list-style-type:none;
  margin-top:0;
  margin-bottom:0;
  padding-left:0;
}
.well {
  background-color:rgba(0,0,0,0.12);
  padding: $column-gutter;
  border-radius: 0;
  border:1px solid rgba(0,0,0,0.12);
}
.swell {
  @extend .well;
  padding:initial;
}
.lined {
  border:1px solid rgba(0,0,0,0.5);
}
.centered-child {
  position:absolute;
  top:50%;
  left:50%;
  -webkit-transform:translate(-50%,-50%);
  transform:translate(-50%,-50%);
}
.fill-child {
  height:100%;
  width:100%;
}
.square-parent {
  position:relative;
  height:0;
  padding-bottom:100%;
}
.square-child {
  @extend .fill-child;
  position:absolute;
}

table {
  width:100%;
  border-collapse:collapse;
}
td,
th{
  padding:$column-gutter/2;
  text-align:left;
}
tr {
  border-bottom:1px solid rgba(0,0,0,0.12);
}

/* end design stuff */


 
@mixin make-box-utilities($pre:''){
	@each $pre-short,$pre-long in $boxes-map {
		@each $suf-short,$suf-long in $sizes-map {
			@each $pos-short,$pos-long in $positions-map {
				.#{$pre-short}#{$pre}-#{$pos-short}#{$suf-short} {
					#{$pre-long}-#{$pos-long}: $suf-long;
				}
			}
			.#{$pre-short}#{$pre}-h#{$suf-short} {
				#{$pre-long}-left: $suf-long;
				#{$pre-long}-right: $suf-long;
			}
			.#{$pre-short}#{$pre}-v#{$suf-short} {
				#{$pre-long}-top: $suf-long;
				#{$pre-long}-bottom: $suf-long;
			}
			.#{$pre-short}#{$pre}-#{$suf-short} {
				#{$pre-long}: $suf-long;
			}
		}
	}
}
@mixin make-main-utilities($pre:'') {
	.pull#{$pre}-left {
		float:left;
	}
	.pull#{$pre}-right {
		float:right;
	}
	.pull#{$pre}-none {
		float:none;
	}
	.pull#{$pre}-clear {
		clear:both;
	}
	.pull#{$pre}-center {
		margin-left:auto;
		margin-right:auto;
	}

	// Make horizontal alignments
	@each $short,$long in $alignment-hor-map {
		.align#{$pre}-#{$short} {
			text-align:$long;
		}
	}
	// Make vertical alignments
	@each $short,$long in $alignment-ver-map {
		.align#{$pre}-#{$short} {
			vertical-align:$long;
		}
	}
	// Make display varieties
	@each $short,$long in $display-map {
		.display#{$pre}-#{$short} {
			display:$long;
		}
	}
	// Make positioning varieties
	@each $short,$long in $positioning-map {
		.position#{$pre}-#{$short} {
			position:$long;
		}
	}
}


@mixin make-container($pre:''){
	.container {
		margin-right:auto;
		margin-left:auto;
    padding:0;
		@if($pre=='xl') {
			max-width:map-get($container-map,$pre);
		} @else if($pre=='lg') {
			max-width:map-get($container-map,$pre);
		} @else  {
			max-width:auto;
      padding:$column-gutter;
		}
	}
}

@mixin make-columns{
	[class*='col-'] {
		float: left;
		min-height: 1px;
	}
  .grid {
		overflow:hidden;
  }
	.row {
		&:after {
			@include clearfix;
		}
		&.gutters {
      margin-top: -$column-gutter;
			margin-left: -($column-gutter / 2);
			margin-right: -($column-gutter / 2);

			&>[class*='col-'] {
        padding-top: $column-gutter;
				padding-left: ($column-gutter / 2);
				padding-right: ($column-gutter / 2);
			}
		}
	}
}

@mixin make-runny-columns($pre:'') {
	@if($pre!='') {
		$pre: "-#{$pre}";
  }
  .col#{$pre}-side {
    width:$side-column-width;
  }
  .col#{$pre}-main {
    width:calc(100% - #{$side-column-width});
  }
  .col#{$pre}-main2 {
    width:calc(100% - #{$side-column-width * 2});
  }

  .flex#{$pre}-parent {
    display:-webkit-flex;
    display:flex;
    -webkit-align-items:stretch;
    align-items:stretch;
  }
  .flex#{$pre}-wrap {
      -webkit-flex-wrap:wrap;
      flex-wrap:wrap;
  }
  .flex#{$pre}-nowrap {
      -webkit-flex-wrap:nowrap;
      flex-wrap:nowrap;
  }
  .flex#{$pre}-child {
    -webkit-flex:1 1 auto;
    flex:1 1 auto;
  }
  .flex#{$pre}-none {
    -webkit-flex:none;
    flex:none;
  }

	@for $i from 0 through $column-length {
		.col#{$pre}-#{$i} {
			width: percentage($i/$column-length);
		}
		.offset#{$pre}-#{$i} {
			margin-left: percentage($i/$column-length);
		}
	}
}









@include make-container;
@include make-runny-columns;
@include make-box-utilities;
@include make-main-utilities;
@include make-columns;
@each $pre-short,$pre-long in $container-map {
    /*---------------------------------------------------------------
    #{$pre-short} media minimum
    -----------------------------------------------------------------*/
    @media (min-width:$pre-long) {
        @include make-container(#{$pre-short});
        @include make-runny-columns(#{$pre-short});
        @include make-box-utilities(-#{$pre-short});
        @include make-main-utilities(-#{$pre-short});
    }
}
            
          
!
            
              $("div.header").on("click",function(){
  $(this).addClass("active")
    .siblings("div.header").removeClass("active");
  
  var target = "#"+$(this).data("id");
  
  // Smoothscroll after the view redraws
  setTimeout(function(){
    $(".main-body").children("body").animate({
        scrollTop:$(target).offset().top
    },500);
  },100);
})
            
          
!
999px
Loading ..................

Console