A Pen by Stephan Pohl on CodePen.
Created
August 26, 2014 10:45
-
-
Save klarstil/ed35060910a086637500 to your computer and use it in GitHub Desktop.
A Pen by Stephan Pohl.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$( function() { | |
$('.shopping-world--container').isotope({ | |
itemSelector: '.shopping-world--entry', | |
masonry: { | |
gutter: '.gutter--sizer', | |
columnWidth: '.grid--sizer' | |
} | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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