Skip to content

Instantly share code, notes, and snippets.

@chrisdpeters
Last active December 31, 2015 01:58
Show Gist options
  • Save chrisdpeters/7917372 to your computer and use it in GitHub Desktop.
Save chrisdpeters/7917372 to your computer and use it in GitHub Desktop.
How to use the ZURB Foundation grid system without the meaningless class names http://www.chrisdpeters.com/foundation-grid-system-without-meaningless-class-names/
@import "foundation/components/grid";
.layout {
// `layout` container functions as a row
@include grid-row();
}
.layout-content {
// Mobile-first: make `layout-container` full-width
@include grid-column(12);
// On medium-up size, make `layout-container` 9 columns wide
@media #{$medium-up} {
@include grid-column(9);
}
}
.layout-sidebar {
// Mobile-first: make `layout-sidebar` full-width
@include grid-column(12);
// On medium-up size, make `layout-sidebar` 3 columns wide
@media #{$medium-up} {
@include grid-column(3);
}
}
// b. Grid
// - - - - - - - - - - - - - - - - - - - - - - - - -
$include-html-grid-classes: false;
<div class="row">
<main class="medium-9 columns">
<p>Main content</p>
</main>
<aside class="medium-3 columns">
<p>Sidebar</p>
</aside>
</div>
<div class="layout">
<main class="layout-content">
<p>Main content</p>
</main>
<aside class="layout-sidebar">
<p>Sidebar</p>
</aside>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment