Skip to content

Instantly share code, notes, and snippets.

@mirisuzanne
Created May 20, 2015 16:37
Show Gist options
  • Save mirisuzanne/726904de7e095b203914 to your computer and use it in GitHub Desktop.
Save mirisuzanne/726904de7e095b203914 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
<div class="gallery">
<div class="item item1of3">1...</div>
<div class="item item1of3">1...</div>
<div class="item item1of3">1...</div>
<div class="item item2of3">2...</div>
<div class="item item1of3">1...</div>
<div class="item item3of3">3...</div>
<div class="item item1of3">1...</div>
<div class="item item2of3">2...</div>
<div class="item item2of3">2...</div>
</div>
// ----
// Sass (v3.4.13)
// Compass (v1.0.3)
// Susy (v2.2.5)
// ----
@import 'susy';
.gallery {
@include container(60rem);
background: #eee;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.item {
flex: 0 0 auto;
height: 3rem;
margin: .25rem 0;
}
.item1of3 {
background: red;
width: span(1 of 3);
}
.item2of3 {
background: blue;
width: span(2 of 3);
}
.item3of3 {
background: purple;
width: span(3 of 3);
}
.gallery {
max-width: 60rem;
margin-left: auto;
margin-right: auto;
background: #eee;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.gallery:after {
content: " ";
display: block;
clear: both;
}
.item {
flex: 0 0 auto;
height: 3rem;
margin: .25rem 0;
}
.item1of3 {
background: red;
width: 28.57143%;
}
.item2of3 {
background: blue;
width: 64.28571%;
}
.item3of3 {
background: purple;
width: 100%;
}
<div class="gallery">
<div class="item item1of3">1...</div>
<div class="item item1of3">1...</div>
<div class="item item1of3">1...</div>
<div class="item item2of3">2...</div>
<div class="item item1of3">1...</div>
<div class="item item3of3">3...</div>
<div class="item item1of3">1...</div>
<div class="item item2of3">2...</div>
<div class="item item2of3">2...</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment