Last active
August 29, 2015 14:00
-
-
Save finteractive/11459762 to your computer and use it in GitHub Desktop.
Layout Grid (BEM/SMACSS Style)
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
<div class="l-region-2cols--1-2"> | |
<div class="panel-pane"> | |
<h2 class="panel-title">Tardar Sauce</h2> | |
<div class="panel-content">Grumpy Cat, real name Tardar Sauce, is a cat and Internet celebrity known for her grumpy facial expression. Her owner Tabatha Bundesen says that her permanently grumpy-looking face is due to feline dwarfism.</div> | |
</div> | |
<div class="panel-pane"> | |
<h2 class="panel-title">Tardar Sauce</h2> | |
<div class="panel-content">Grumpy Cat, real name Tardar Sauce, is a cat and Internet celebrity known for her grumpy facial expression. Her owner Tabatha Bundesen says that her permanently grumpy-looking face is due to feline dwarfism.</div> | |
</div> | |
</div> |
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
* { | |
-moz-box-sizing: border-box; | |
-webkit-box-sizing: border-box; | |
box-sizing: border-box; | |
} | |
.l-region-2cols--1-2 { | |
margin-bottom: 2em; | |
} | |
@media (min-width: 800px) { | |
.l-region-2cols--1-2 > .panel-pane { | |
width: 50%; | |
} | |
.l-region-2cols--1-2 > .panel-pane:nth-of-type(2n+1) { | |
clear: left; | |
float: left; | |
padding-right: 1m; | |
} | |
.l-region-2cols--1-2 > .panel-pane:nth-of-type(2n+2) { | |
clear: right; | |
float: right; | |
padding-left: 1m; | |
} | |
} | |
.panel-pane { | |
padding: 1em; | |
} |
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
<div class="l-region-2cols--1-2"> | |
<div class="panel-pane"> | |
<h2 class="panel-title">Tardar Sauce</h2> | |
<div class="panel-content">Grumpy Cat, real name Tardar Sauce, is a cat and Internet celebrity known for her grumpy facial expression. Her owner Tabatha Bundesen says that her permanently grumpy-looking face is due to feline dwarfism.</div> | |
</div> | |
<div class="panel-pane"> | |
<h2 class="panel-title">Tardar Sauce</h2> | |
<div class="panel-content">Grumpy Cat, real name Tardar Sauce, is a cat and Internet celebrity known for her grumpy facial expression. Her owner Tabatha Bundesen says that her permanently grumpy-looking face is due to feline dwarfism.</div> | |
</div> | |
</div> |
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
// ---- | |
// Sass (v3.3.6) | |
// Compass (v) | |
// Breakpoint (v) | |
// ---- | |
@import "compass"; | |
@import "breakpoint"; | |
$bp-med: 800px; | |
*{ | |
@include box-sizing(border-box); | |
} | |
// Default - 1 column to 2 cols @ bp-med | |
%l-region-2cols--1-2, | |
.l-region-2cols--1-2{ | |
//@extend %clearfix; | |
margin-bottom: 2em; | |
>.panel-pane{ | |
@include breakpoint($bp-med, $no-query: true){ | |
width: 50%; | |
&:nth-of-type(2n+1){ | |
clear: left; | |
float: left; | |
padding-right: 1m; | |
} | |
&:nth-of-type(2n+2){ | |
clear: right; | |
float: right; | |
padding-left: 1m; | |
} | |
} | |
} | |
} | |
.panel-pane{ | |
padding: 1em; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment