Skip to content

Instantly share code, notes, and snippets.

@JeroenVdb
Created June 23, 2015 08:17
Show Gist options
  • Select an option

  • Save JeroenVdb/74d50268f1748f1ba1fb to your computer and use it in GitHub Desktop.

Select an option

Save JeroenVdb/74d50268f1748f1ba1fb to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
<div class="container">
<div class="sixpack--1">
<div class="tile tile--1">tile 1</div>
<div class="tile tile--2">tile 2</div>
<div class="tile tile--3">tile 3</div>
</div>
</div>
// ----
// Sass (v3.4.14)
// Compass (v1.0.3)
// ----
* {
box-sizing: border-box;
}
.container {
background-color: blue;
width: 900px;
height: 900px;
}
@mixin tile($width, $height) {
width: percentage($width / 2);
padding-top: percentage($height / 3);
}
.sixpack--1 {
.tile--1 {
@include tile(2, 3)
}
.tile--2 {
@include tile(2, 2)
}
.tile--3 {
@include tile(2, 1)
}
}
.tile {
background-color: red;
}
* {
box-sizing: border-box;
}
.container {
background-color: blue;
width: 900px;
height: 900px;
}
.sixpack--1 .tile--1 {
width: 100%;
padding-top: 100%;
}
.sixpack--1 .tile--2 {
width: 100%;
padding-top: 66.66667%;
}
.sixpack--1 .tile--3 {
width: 100%;
padding-top: 33.33333%;
}
.tile {
background-color: red;
}
<div class="container">
<div class="sixpack--1">
<div class="tile tile--1">tile 1</div>
<div class="tile tile--2">tile 2</div>
<div class="tile tile--3">tile 3</div>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment