Skip to content

Instantly share code, notes, and snippets.

@klarstil
Created August 26, 2014 10:45
Show Gist options
  • Save klarstil/ed35060910a086637500 to your computer and use it in GitHub Desktop.
Save klarstil/ed35060910a086637500 to your computer and use it in GitHub Desktop.
A Pen by Stephan Pohl.
<ul class="shopping-world--container">
<div class="grid--sizer"></div>
<div class="gutter--sizer"></div>
<li class="shopping-world--entry w2"></li>
<li class="shopping-world--entry"></li>
<li class="shopping-world--entry"></li>
<li class="shopping-world--entry"></li>
<li class="shopping-world--entry"></li>
<li class="shopping-world--entry"></li>
<li class="shopping-world--entry"></li>
<li class="shopping-world--entry"></li>
<li class="shopping-world--entry"></li>
<li class="shopping-world--entry"></li>
<li class="shopping-world--entry"></li>
</ul>
$( function() {
$('.shopping-world--container').isotope({
itemSelector: '.shopping-world--entry',
masonry: {
gutter: '.gutter--sizer',
columnWidth: '.grid--sizer'
}
});
});
@mobileLandscapeViewportWidth: 30em;
@tabletViewportWidth: 48em; // 768px
@tabletLandscapeViewportWidth: 64em; // 1024px
@desktopViewportWidth: 78.75em; // 1260px
html {
box-sizing: border-box;
}
*, *:before, *:after {
box-sizing: inherit;
}
.shopping-world--container {
list-style: none;
width: 100%;
margin: 0; padding: 0;
display: block;
overflow: hidden;
}
.grid--sizer {
width: 99%
}
.gutter--sizer { width: 1%; }
.shopping-world--entry {
width: 99%;
height: 250px;
background: #f00;
margin: 0 0 1%; padding: 0;
&:nth-child(2n) {
background: #0f0
}
&:nth-child(3n) {
background: #00f
}
}
@media screen and (min-width: @mobileLandscapeViewportWidth) {
.grid--sizer, .shopping-world--entry {
width: 49%;
}
.w2 {
width: 99%;
}
}
@media screen and (min-width: @tabletViewportWidth) {
.grid--sizer, .shopping-world--entry {
width: 32.3333%;
}
.w2 {
width: 65.3333%
}
}
@media screen and (min-width: @tabletLandscapeViewportWidth) {
.grid--sizer, .shopping-world--entry {
width: 24%;
}
.w2 {
width: 49%;
}
}
@media screen and (min-width: @desktopViewportWidth) {
.grid--sizer, .shopping-world--entry {
width: 19%;
}
.w2 {
width: 39%
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment