Skip to content

Instantly share code, notes, and snippets.

@Snugug
Created June 2, 2015 15:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Snugug/9810ecf11c87abe495f7 to your computer and use it in GitHub Desktop.
Save Snugug/9810ecf11c87abe495f7 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
<div id="one">
<p>one</p>
<div class="childOne"><p>child1</p></div>
<div class="childTwo"><p>child2</p></div>
</div>
<div id="two">
<p>two</p>
</div>
// ----
// libsass (v3.2.4)
// ----
@import 'singularitygs';
@import 'breakpoint';
$desktop: 600px;
@include add-grid(4 at $desktop);
div {
text-align: center;
min-width: 50px;
min-height: 50px;
p {
position: relative;
top: 50%;
transform: translateY(-50%);
}
}
#one {
background-color: lightblue;
width: 300px;
height: 200px;
@include breakpoint($desktop) {
@include grid-span(2, 1);
@include layout(2) {
.childOne {
background-color: gray;
@include grid-span(1, 1);
}
.childTwo {
background-color: lightgray;
@include grid-span(1, 2);
}
}
}
}
#two {
background-color: lightblue;
width: 300px;
height: 200px;
@include breakpoint($desktop) {
@include grid-span(2, 3);
}
}
div {
text-align: center;
min-width: 50px;
min-height: 50px;
}
div p {
position: relative;
top: 50%;
transform: translateY(-50%);
}
#one {
background-color: lightblue;
width: 300px;
height: 200px;
}
@media (min-width: 600px) {
#one {
width: 47.36842%;
float: left;
margin-right: -100%;
margin-left: 0;
clear: none;
}
#one .childOne {
background-color: gray;
width: 44.44444%;
float: left;
margin-right: -100%;
margin-left: 0;
clear: none;
}
#one .childTwo {
background-color: lightgray;
width: 44.44444%;
float: right;
margin-left: 0;
margin-right: 0;
clear: none;
}
}
#two {
background-color: lightblue;
width: 300px;
height: 200px;
}
@media (min-width: 600px) {
#two {
width: 47.36842%;
float: right;
margin-left: 0;
margin-right: 0;
clear: none;
}
}
<div id="one">
<p>one</p>
<div class="childOne"><p>child1</p></div>
<div class="childTwo"><p>child2</p></div>
</div>
<div id="two">
<p>two</p>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment