Skip to content

Instantly share code, notes, and snippets.

@poeticninja
Created July 12, 2013 15:11
Show Gist options
  • Save poeticninja/5985220 to your computer and use it in GitHub Desktop.
Save poeticninja/5985220 to your computer and use it in GitHub Desktop.
Here is how to add Medium to the Zurb Foundation 4 CSS framework. This makes the grid change on any html with the medium-$ class. Great for iPad and more custom sizing of website. Make sure you add this after the @import "foundation/components/global", "foundation/components/grid";.
@if $include-html-grid-classes != false {
/* Styles for screens that are atleast 768px and max width 1024px */
@media #{$small} and (max-width: 1024px) {
@for $i from 1 through $total-columns {
.medium#{-$i} { @include grid-column($columns:$i,$collapse:null,$float:false); }
}
@for $i from 0 through $total-columns - 1 {
.row .medium-offset-#{$i} { @include grid-column($offset:$i, $collapse:null,$float:false); }
}
@for $i from 1 through $total-columns - 1 {
.push#{-$i} { @include grid-column($push:$i, $collapse:null, $float:false); }
.pull#{-$i} { @include grid-column($pull:$i, $collapse:null, $float:false); }
}
.column.medium-centered,
.columns.medium-centered { @include grid-column($center:true, $collapse:null, $float:false); }
.column.medium-uncentered,
.columns.medium-uncentered {
margin-#{$default-float}: 0;
margin-#{$opposite-direction}: 0;
float: $default-float !important;
}
.column.medium-uncentered.opposite,
.columns.medium-uncentered.opposite {
float: $opposite-direction !important;
}
}
}
Copy link

ghost commented Oct 26, 2013

Huh? Where do we put this? I am using the Reverie framework for WordPress. I looked through the files and I can't imagine where this goes. Can't we just add the CSS file?

@ahmadajmi
Copy link

@jkinley checkout the new experimental feature for medium grid and this is the CSS file

@EmilyRyan
Copy link

This is what I was looking for! The link in the Zurb docs no longer works. Where do I put this if I use regular and <script src="> for linking in foundation 4 to my html-page? What file are you pasting this in?

@EmilyRyan
Copy link

This is what I was looking for! The link in the Zurb docs no longer works. Where do I put this if I use regular link rel and script src for linking in foundation 4 to my html-page? What file are you pasting this in?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment