Difference between revisions of "Susy Grid"

From rbachwiki
Jump to navigation Jump to search
Line 1: Line 1:
==  Responsive Design using Breakpoint ==
==  Responsive Design using Breakpoint ==


<ul>
<pre>
  <li>Breakpoint needs to be installed</li>
Breakpoint needs to be installed
  <li>gem install breakpoint</li>
gem install breakpoint
  <li>@ require 'breakpoint'; // in the config.rb file</li>
@ require 'breakpoint'; // in the config.rb file
    
    
</ul>
</pre>


== To use breakpoint, wrap your code into a breakpoint function ==
== To use breakpoint, wrap your code into a breakpoint function ==


<code>
<pre>
   $small: 500px;
   $small: 500px;
   $large: 1200px;
   $large: 1200px;
Line 36: Line 36:
@include span(3 at 21);
@include span(3 at 21);
}
}
</code>
</pre>
<h2>
==  Breakpoint mixin ==
  Breakpoint mixin
 
</h2>
<pre>
<code>
susy-breakpoint($large, 24) // if you use this you dont have to @include layout(24)
susy-breakpoint($large, 24) // if you use this you dont have to @include layout(24)
   @include pad(10px)
   @include pad(10px)
    
    
</code>
</pre>

Revision as of 21:12, 5 August 2016

Responsive Design using Breakpoint

Breakpoint needs to be installed
gem install breakpoint
@ require 'breakpoint'; // in the config.rb file
  

To use breakpoint, wrap your code into a breakpoint function

  $small: 500px;
  $large: 1200px;
  
	breakpoint($small)
  {
  	main { @include span(8);
  }
  
  aside {
  	@include span(4 at 9);
  }
  
  @include breakpoint($large){
	@include layout(24);
	
	main {
	@include span(21);
	.col1, .col2, .col3 {
		@include span(8);
	}
}

aside {
	@include span(3 at 21);
}

Breakpoint mixin

susy-breakpoint($large, 24) // if you use this you dont have to @include layout(24)
  @include pad(10px)